You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2005/01/11 20:54:00 UTC

svn commit: r124918 - in incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master master/DerbyNet master/j9_13 suites testData testData/ImportExport tests/jdbcapi tests/lang tests/store tests/tools util

Author: kmarsden
Date: Tue Jan 11 11:53:57 2005
New Revision: 124918

URL: http://svn.apache.org/viewcvs?view=rev&rev=124918
Log:
next installment of tests from IBM - prepared by myrna@golux.com 
includes jdbc20 suite, jdk14 suite, jdbcapi suite, and more store, tools and lang tests.

Added:
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Beetle6038.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/StmtCloseFunTest.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/characterStreams.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/getCurConnJdbc20.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/maxfieldsize.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/prepStmtMetaData.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers1.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsersldap.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users2.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/EscalateLock.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/StmtCloseFunTest.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/URLCheck.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/backupRestore1.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/batchUpdate.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bestrowidentifier.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bootLock.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkPoint.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/databaseProperties.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurConnJdbc20.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorJava.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij2.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij4.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij6.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExport.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij5.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ijConnName.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxfieldsize.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nullSQLText.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmtMetaData.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/procedureJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readUncommitted.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readlocks.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc20.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc30.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rollForwardBackup.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors2.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors3.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers1.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsersldap.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocks.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocksJDBC30.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users2.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaJNDI.out   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access1.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access2.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access3.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt1.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt2.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt3.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt4.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt5.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt6.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/EndOfFile.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor1.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor2.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor3.asc   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/copyfiles.ant   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/db2ttypes.del   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/mixednl.del
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/position_info.del
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere1.txt
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere2.txt
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/aclob.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/empty.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/getCurConnJdbc20.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/littleclob.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.gif   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/searchclob.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/short.txt   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaJNDI.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors3.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock1.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675.data   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675trailingblanks.data   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703.data   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703trailingblanks.data   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/derby.banner   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/empty.data   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeCursorLocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeSetLocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readCursorLocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readSetLocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readlocks.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/short.data   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/shortbanner   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeCursorLocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeHoldCursorLocksJDBC30.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeSetLocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatecursorlocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateholdcursorlocksJDBC30.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocks.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatesetlocks.subsql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_derby.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_app.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_sed.properties   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/Jdbc20Test.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/copyfiles.ant   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/metadataHelperProcs.java   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/testRoutines.sql   (contents, props changed)
Modified:
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.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/derbytools.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall
   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/xa.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml
   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/jdbcapi/savepointJdbc30.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql
   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/compressTable.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql
   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/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Beetle6038.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Beetle6038.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Beetle6038.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2 @@
+data_encrypt_algorithm_version=1
+log_encrypt_algorithm_version=1

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/StmtCloseFunTest.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/StmtCloseFunTest.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/StmtCloseFunTest.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,21 @@
+Statement Close Fun Test starting 
+Statement test begin
+beetle 5524
+Statement Test failed (12)
+beetle 5524
+Statement Test failed (13)
+Statement test end
+Prepared Statement test begin
+beetle 5524
+Prepared Statement Test failed
+beetle 5524
+Prepared Statement Test failed
+Prepared Statement test end
+Callable Statement test begin
+The result is 3
+beetle 5524
+Callable Statement Test failed
+beetle 5524
+Callable Statement Test failed
+Callable Statement test end
+Statement Close Fun Test finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,273 @@
+Test autoGeneratedJdbc30 starting
+Test 1 - request for generated keys resultset on a brand new statement with no sql executed on it yet
+We will get a resultset with no rows because it is a non-insert sql
+<NULL>
+Test2 - request for generated keys on a statement which does select from a table ie a non-insert sql
+We will get a resultset with no rows because it is a non-insert sql
+<NULL>
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+<NULL>
+Test 3 - insert multiple rows into a table with autogenerated key and request generated keys resultset
+ We will get a row with NULL value because this insert sql inserted more than one row and 
+ there was no prior one-row insert into a table with autogenerated key
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 4 - request for generated keys after doing an insert into a table with no auto generated keys
+ And there has been no one-row insert into a table with auto-generated keys yet.
+We should get a resultset with one row of NULL value from getGeneratedKeys
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 5a - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
+Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 5b - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
+Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 5c - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
+Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 6 - request for generated keys after doing a one-row insert into a table with auto generated keys
+We should get a resultset with one row of non-NULL value
+	 1
+	 -
+	{29}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{30}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{31}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 7 - Now try again inserting multiple rows into a table with autogenerated key and request generated keys resultset
+ This time we will get a row of non-NULL value because there has been a prior one-row insert into table with auto-generated key 
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 8 - create a new statement and request for generated keys on it after doing an insert into 
+ a table with no auto generated keys
+We should get a resultset with one row of non-NULL value
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 9 - request for generated keys on a statement which does a update 
+We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
+<NULL>
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+<NULL>
+Test 10 - request for generated keys on a statement which does a delete 
+We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
+<NULL>
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+<NULL>
+Test 11 - do a commit and request for generated keys on a statement which does insert into a table with 
+ no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
+expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 12 - do a rollback and request for generated keys on a statement which does insert into a table with 
+ no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
+had expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 13 - try savepoint rollback and see what happens to auto generated keys resultset
+Inside the savepoint unit, issue a one-row insert into a table with auto generated keys
+We should get a resultset with one row of non-NULL value
+	 1
+	 -
+	{33}
+Now rollback the savepoint unit, and make sure that autogenerated keys resultset still holds on to 
+ value that got set inside the rolled back savepoint unit
+	 1
+	 -
+	{33}
+Test 14 - Look at metadata of a getGeneratedKeys resultset
+The resultset will have one column only
+Found 1 column in the resultset
+Type of the column is DECIMAL
+Precision of the column is 31
+Scale of the column is 0
+	 1
+	 -
+	{25}
+Test 15 - Can not see the auto generated keys if insert is with NO_GENERATED_KEYS
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test 16 - Can not see the auto generated keys if insert is done jdbc 2.0 way ie with no generated key feature
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test 17 - non-insert with NO_GENERATED_KEYS
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test 18 - non-insert is done jdbc 2.0 way ie with no generated key feature
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test19 - fix the no auto generated key resultset generated for INSERT with generated keys if server-side methods are invoked
+Back to client side looking for auto generated keys
+	 1
+	 -
+	{33}
+	 1
+	 -
+	{16}
+Test20 - bug 4837garbage collection of the generated key result sets was closing the activation.
+Test21 - insert select with columnIndexes[] array should fail
+Try passing array with Statement.execute
+PASS - expected exception - Feature not implemented
+Try passing array with Statement.executeUpdate
+PASS -- expected exception
+SQLSTATE(null): Driver not capable
+Test21ps - insert select with columnIndexes[] array should fail
+Try passing array with Connection.prepareStatement
+PASS -- expected exception
+SQLSTATE(null): Driver not capable
+Test22 - insert select with columnNames[] array should fail
+Try passing array with Statement.execute
+PASS -- expected exception
+SQLSTATE(null): Driver not capable
+Try passing array with Statement.executeUpdate
+PASS -- expected exception
+SQLSTATE(null): Driver not capable
+Test22ps - insert select with columnNames[] array should fail
+Try passing array with Connection.prepareStatement
+PASS -- expected exception
+SQLSTATE(null): Driver not capable
+Test autoGeneratedJdbc30 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,721 @@
+Test blobclob starting
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+unicode string 0 correct
+unicode string 1 correct
+unicode string 2 correct
+Finished prepareUnicodeFile
+Length of clob is 5009
+unicode string 0 matched
+unicode string 1 matched
+unicode string 2 matched
+EOF matched
+setCharacterStreamTest finished
+clobTest0 finished
+clobTest11 finished
+Succeeded to match, row 1
+PASSED, row 1, length was 3
+Succeeded to match, row 2
+PASSED, row 2, length was 3
+Succeeded to match, row 3
+PASSED, row 3, length was 3
+Succeeded to match, row 4
+PASSED, row 4, length was 5016
+Succeeded to match, row 5
+PASSED, row 5, length was 5016
+Succeeded to match, row 6
+PASSED, row 6, length was 5016
+clobTest12 finished
+CLOB getSubString 9905 > 0
+Known JCC Bug 5914 - String index out of range: -9904
+CLOB getSubString 5910 > 0
+Known JCC Bug 5914 - String index out of range: -5909
+CLOB getSubString 5910 > 0
+Known JCC Bug 5914 - String index out of range: -5909
+CLOB getSubString 204 > 0
+Known JCC Bug 5914 - String index out of range: -203
+CLOB getSubString 68 > 0
+Known JCC Bug 5914 - String index out of range: -67
+CLOB getSubString 1 > 0
+1(5) (len 50) 
+CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+CLOB getSubString 1 > 0
+1(6) (len 1) 
+CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+CLOB getSubString 9905 > 65
+Known JCC Bug 5914 - String index out of range: -9839
+CLOB getSubString 5910 > 65
+Known JCC Bug 5914 - String index out of range: -5844
+CLOB getSubString 5910 > 65
+Known JCC Bug 5914 - String index out of range: -5844
+CLOB getSubString 204 > 65
+Known JCC Bug 5914 - String index out of range: -138
+CLOB getSubString 68 > 65
+Known JCC Bug 5914 - String index out of range: -2
+2(5) (len 50) you can lead a horse to water but you can't form i
+2(6) (len 1) y
+CLOB getSubString 9905 > 26
+Known JCC Bug 5914 - String index out of range: -9878
+CLOB getSubString 5910 > 26
+Known JCC Bug 5914 - String index out of range: -5883
+CLOB getSubString 5910 > 26
+Known JCC Bug 5914 - String index out of range: -5883
+CLOB getSubString 204 > 26
+Known JCC Bug 5914 - String index out of range: -177
+CLOB getSubString 68 > 26
+Known JCC Bug 5914 - String index out of range: -41
+3(5) (len 50) a stitch in time says ouch
+3(6) (len 1) a
+CLOB getSubString 9905 > 42
+Known JCC Bug 5914 - String index out of range: -9862
+CLOB getSubString 5910 > 42
+Known JCC Bug 5914 - String index out of range: -5867
+CLOB getSubString 5910 > 42
+Known JCC Bug 5914 - String index out of range: -5867
+CLOB getSubString 204 > 42
+Known JCC Bug 5914 - String index out of range: -161
+CLOB getSubString 68 > 42
+Known JCC Bug 5914 - String index out of range: -25
+4(5) (len 50) here is a string with a return 
+ character
+4(6) (len 1) h
+CLOB getSubString 9905 > 56
+Known JCC Bug 5914 - String index out of range: -9848
+CLOB getSubString 5910 > 56
+Known JCC Bug 5914 - String index out of range: -5853
+CLOB getSubString 5910 > 56
+Known JCC Bug 5914 - String index out of range: -5853
+CLOB getSubString 204 > 56
+Known JCC Bug 5914 - String index out of range: -147
+CLOB getSubString 68 > 56
+Known JCC Bug 5914 - String index out of range: -11
+5(5) (len 50) test data: a string column inserted as an Ascii st
+5(6) (len 1) t
+6(0) (len 50) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
+6(1) (len 150) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(2) (len 50) I-am-hiding-here-at-position-5910-in-this-little-c
+6(3) (len 50) This-is-position-204wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(4) (len 50) wposition-69-end-of-the-first-l
+ine-we-are-now-on
+6(5) (len 50) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(6) (len 1) B
+6(7) 
+wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+CLOB getSubString 9905 > 0
+Known JCC Bug 5914 - String index out of range: -9904
+CLOB getSubString 5910 > 0
+Known JCC Bug 5914 - String index out of range: -5909
+CLOB getSubString 5910 > 0
+Known JCC Bug 5914 - String index out of range: -5909
+CLOB getSubString 204 > 0
+Known JCC Bug 5914 - String index out of range: -203
+CLOB getSubString 68 > 0
+Known JCC Bug 5914 - String index out of range: -67
+CLOB getSubString 1 > 0
+7(5) (len 50) 
+CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+CLOB getSubString 1 > 0
+7(6) (len 1) 
+CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE 1 > 0
+CLOB getSubString 9905 > 5000
+Known JCC Bug 5914 - String index out of range: -4904
+CLOB getSubString 5910 > 5000
+Known JCC Bug 5914 - String index out of range: -909
+CLOB getSubString 5910 > 5000
+Known JCC Bug 5914 - String index out of range: -909
+8(3) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(4) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+8(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(6) (len 1) w
+8(7) 
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(0) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(1) (len 150) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(2) (len 50) I-am-hiding-here-at-position-5910-in-this-humungus
+9(3) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(4) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+9(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(6) (len 1) w
+9(7) 
+wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+clobTest2 finished
+Row 1 : Succeeded
+Row 2 : Succeeded
+Row 3 : Succeeded
+Row 4 : Succeeded
+Second time Succeeded
+Row 5 : Succeeded
+Second time Succeeded
+Row 6 : Succeeded
+Second time Succeeded
+clobTest22 finished
+Found horse in row 1 starting from position 1 at position  NOTFOUND 
+Found ouch in row 1 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 1 starting from position 1 at position  NOTFOUND 
+Found  in row 1 starting from position 1 at position 1
+Found Beginning in row 1 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 1 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 1 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 1 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 1 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 1 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 1 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 1 starting from position 1 at position  NOTFOUND 
+Found horse in row 2 starting from position 1 at position 16
+Found ouch in row 2 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 2 starting from position 1 at position  NOTFOUND 
+Found  in row 2 starting from position 1 at position 1
+Found Beginning in row 2 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 2 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 2 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 2 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 2 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 2 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 2 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 2 starting from position 1 at position  NOTFOUND 
+Found horse in row 3 starting from position 1 at position  NOTFOUND 
+Found ouch in row 3 starting from position 1 at position 23
+Found 
+ in row 3 starting from position 1 at position  NOTFOUND 
+Found  in row 3 starting from position 1 at position 1
+Found Beginning in row 3 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 3 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 3 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 3 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 3 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 3 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 3 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 3 starting from position 1 at position  NOTFOUND 
+Found horse in row 4 starting from position 1 at position  NOTFOUND 
+Found ouch in row 4 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 4 starting from position 1 at position 32
+Found  in row 4 starting from position 1 at position 1
+Found Beginning in row 4 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 4 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 4 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 4 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 4 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 4 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 4 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 4 starting from position 1 at position  NOTFOUND 
+Found horse in row 5 starting from position 1 at position  NOTFOUND 
+Found ouch in row 5 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 5 starting from position 1 at position 56
+Found  in row 5 starting from position 1 at position 1
+Found Beginning in row 5 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 5 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 5 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 5 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 5 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 5 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 5 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 5 starting from position 1 at position  NOTFOUND 
+Found horse in row 6 starting from position 1 at position  NOTFOUND 
+Found ouch in row 6 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 6 starting from position 1 at position 100
+Found  in row 6 starting from position 1 at position 1
+Found Beginning in row 6 starting from position 1 at position 1
+Found Beginning in row 6 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 6 starting from position 1 at position 69
+Found This-is-position-204 in row 6 starting from position 1 at position 204
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 1 at position 5910
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 5910 at position 5910
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 6 starting from position 1 at position 9907
+Found horse in row 7 starting from position 1 at position  NOTFOUND 
+Found ouch in row 7 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 7 starting from position 1 at position  NOTFOUND 
+Found  in row 7 starting from position 1 at position 1
+Found Beginning in row 7 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 7 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 7 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 7 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 7 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 7 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 7 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 7 starting from position 1 at position  NOTFOUND 
+Found horse in row 8 starting from position 1 at position  NOTFOUND 
+Found ouch in row 8 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 8 starting from position 1 at position 100
+Found  in row 8 starting from position 1 at position 1
+Found Beginning in row 8 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 8 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 8 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 8 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 8 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 8 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 8 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 8 starting from position 1 at position  NOTFOUND 
+clobTest3 finished
+Succeeded: Found unicode string 0 at position 1,row 1
+Succeeded: Found unicode string 0 at position -1,row 1
+Succeeded: Found unicode string 1 at position 1,row 2
+Succeeded: Found unicode string 1 at position -1,row 2
+Succeeded: Found unicode string 2 at position 1,row 3
+Succeeded: Found unicode string 2 at position -1,row 3
+Succeeded: Found unicode string 0 at position 1,row 4
+Succeeded: Found unicode string 0 at position 5004,row 4
+Succeeded: Found unicode string 1 at position 1,row 5
+Succeeded: Found unicode string 1 at position 5004,row 5
+Succeeded: Found unicode string 2 at position 1,row 6
+Succeeded: Found unicode string 2 at position 5004,row 6
+clobTest32 finished
+position(clob) NOT FOUND 1 searchStr horse
+position(clob) NOT FOUND 1 searchStr ouch
+position(clob) NOT FOUND 1 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 1 searchStr Beginning
+position(clob) NOT FOUND 1 searchStr position-69
+position(clob) NOT FOUND 1 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 1 searchStr Position-9907
+position(clob) NOT FOUND 1 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 1 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 1 searchStr >150chars
+searchClob row 13 skipped (too large)
+Found horse in row 2 at position 16
+position(clob) NOT FOUND 2 searchStr ouch
+position(clob) NOT FOUND 2 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 65
+position(clob) NOT FOUND 2 searchStr Beginning
+position(clob) NOT FOUND 2 searchStr position-69
+position(clob) NOT FOUND 2 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 2 searchStr Position-9907
+position(clob) NOT FOUND 2 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 2 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 65
+position(clob) NOT FOUND 2 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 3 searchStr horse
+Found ouch in row 3 at position 23
+position(clob) NOT FOUND 3 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 26
+position(clob) NOT FOUND 3 searchStr Beginning
+position(clob) NOT FOUND 3 searchStr position-69
+position(clob) NOT FOUND 3 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 3 searchStr Position-9907
+position(clob) NOT FOUND 3 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 3 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 26
+position(clob) NOT FOUND 3 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 4 searchStr horse
+position(clob) NOT FOUND 4 searchStr ouch
+Found 
+ in row 4 at position 32
+position(clob) FOUND @ 1 with empty search clob in clob of length 42
+position(clob) NOT FOUND 4 searchStr Beginning
+position(clob) NOT FOUND 4 searchStr position-69
+position(clob) NOT FOUND 4 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 4 searchStr Position-9907
+position(clob) NOT FOUND 4 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 4 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 42
+position(clob) NOT FOUND 4 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 5 searchStr horse
+position(clob) NOT FOUND 5 searchStr ouch
+Found 
+ in row 5 at position 56
+position(clob) FOUND @ 1 with empty search clob in clob of length 56
+position(clob) NOT FOUND 5 searchStr Beginning
+position(clob) NOT FOUND 5 searchStr position-69
+position(clob) NOT FOUND 5 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 5 searchStr Position-9907
+Found test data: a string column inserted as an Ascii stream
+ in row 5 at position 1
+position(clob) NOT FOUND 5 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 56
+position(clob) NOT FOUND 5 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 6 searchStr horse
+position(clob) NOT FOUND 6 searchStr ouch
+Found 
+ in row 6 at position 100
+position(clob) FOUND @ 1 with empty search clob in clob of length 10000
+Found Beginning in row 6 at position 1
+Found position-69 in row 6 at position 69
+Found I-am-hiding-here-at-position-5910 in row 6 at position 5910
+Found Position-9907 in row 6 at position 9907
+position(clob) NOT FOUND 6 searchStr test data: a string column inserted as an Ascii stream
+Found clob (row 10)  in row 6 at position 1
+position(clob) FOUND @ 1 with empty search clob in clob of length 10000
+Found clob (row 12)  in row 6 at position 301
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 7 searchStr horse
+position(clob) NOT FOUND 7 searchStr ouch
+position(clob) NOT FOUND 7 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 7 searchStr Beginning
+position(clob) NOT FOUND 7 searchStr position-69
+position(clob) NOT FOUND 7 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 7 searchStr Position-9907
+position(clob) NOT FOUND 7 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 7 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 7 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 8 searchStr horse
+position(clob) NOT FOUND 8 searchStr ouch
+Found 
+ in row 8 at position 100
+position(clob) FOUND @ 1 with empty search clob in clob of length 5000
+position(clob) NOT FOUND 8 searchStr Beginning
+position(clob) NOT FOUND 8 searchStr position-69
+position(clob) NOT FOUND 8 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 8 searchStr Position-9907
+position(clob) NOT FOUND 8 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 8 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 5000
+Found clob (row 12)  in row 8 at position 1
+searchClob row 13 skipped (too large)
+testCLOB_MAIN row 9 skipped (too large)
+clobTest4 finished
+Succeeded: Found clob at position 1,row 0
+Succeeded: Found clob at position 1,row 1
+Succeeded: Found clob at position 1,row 2
+clobTest42 finished
+clobTest51 finished
+create table testInteger (a integer)
+insert into testInteger values('158')
+select a from testInteger
+getClob(1)
+52: SQLException
+EXPECTED SQL Exception: Invalid data conversion: Wrong result column type for requested conversion.
+clobTest53 finished
+start clobTest54
+EXPECTED SQLSTATE(22018): Invalid character string format for type INTEGER.
+end clobTest54
+ negative tests for clob.getSubstring won't run  for network server  until 5243 is fixed
+start clobTest7
+clobTest7 finished
+start clobTest8
+small string pattern
+@1  position MATCH(129)
+@2  position MATCH(2074)
+@3  position MATCH(4595)
+@4  position MATCH(34584)
+@5  position MATCH(67918)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+small java.sql.Clob pattern
+@1  position MATCH(129)
+@2  position MATCH(2074)
+@3  position MATCH(4595)
+@4  position MATCH(34584)
+@5  position MATCH(67918)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+medium string pattern
+@1  position MATCH(11253)
+@2  position MATCH(12225)
+@3  position MATCH(13478)
+@4  position MATCH(43467)
+@5  position MATCH(76801)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+medium java.sql.Clob pattern
+@1  position MATCH(11253)
+@2  position MATCH(12225)
+@3  position MATCH(13478)
+@4  position MATCH(43467)
+@5  position MATCH(76801)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+long string pattern
+@1  position MATCH(287875)
+@2  position MATCH(288847)
+@3  position MATCH(290108)
+@4  position MATCH(305102)
+@5  position MATCH(321769)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+long java.sql.Clob pattern
+@1  position MATCH(287875)
+@2  position MATCH(288847)
+@3  position MATCH(290108)
+@4  position MATCH(305102)
+@5  position MATCH(321769)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+complete clobTest8
+done row 0, length was 0
+done row 1, length was 65
+done row 2, length was 26
+done row 3, length was 42
+done row 4, length was 56
+done row 5, length was 10000
+done row 6, length was 0
+done row 7, length was 5000
+done row 8, length was 300000
+row 9 is null, skipped
+clobTest91 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(40XL1): A lock could not be obtained within the time requested
+clobTest92 finished
+shortClob length after commit is 26
+clobTest94 finished
+shortClob length after closing connection is 26
+EXPECTED SQL Exception: Lob method called after connection was closed
+EXPECTED SQL Exception: Lob method called after connection was closed
+EXPECTED SQL Exception: Lob method called after connection was closed
+EXPECTED SQL Exception: Lob method called after connection was closed
+clobTest95 finished
+clobTest96 finished
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+blobTest0 finished
+testing Blob.getBytes() with pos 9905 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 204 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 68 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 1 > 0
+1(5) 
+FAIL testing Blob.getBytes() with pos 1 > 0
+testing Blob.getBytes() with pos 1 > 0
+1(6) 
+FAIL testing Blob.getBytes() with pos 1 > 0
+testing Blob.getBytes() with pos 9905 > 65
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 65
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 65
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 204 > 65
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 68 > 65
+Known JCC Bug 5914
+2(5) you can lead a horse to water but you can't form i
+2(6) y
+testing Blob.getBytes() with pos 9905 > 26
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 26
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 26
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 204 > 26
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 68 > 26
+Known JCC Bug 5914
+3(5) a stitch in time says ouch
+3(6) a
+testing Blob.getBytes() with pos 9905 > 42
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 42
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 42
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 204 > 42
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 68 > 42
+Known JCC Bug 5914
+4(5) here is a string with a return 
+ character
+4(6) h
+testing Blob.getBytes() with pos 9905 > 56
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 56
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 56
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 204 > 56
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 68 > 56
+Known JCC Bug 5914
+5(5) test data: a string column inserted as an Ascii st
+5(6) t
+6(0) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
+6(1) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(2) I-am-hiding-here-at-position-5910-in-this-little-c
+6(3) This-is-position-204wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(4) wposition-69-end-of-the-first-l
+ine-we-are-now-on
+6(5) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(6) B
+6(7) 
+wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+testing Blob.getBytes() with pos 9905 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 204 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 68 > 0
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 1 > 0
+7(5) 
+FAIL testing Blob.getBytes() with pos 1 > 0
+testing Blob.getBytes() with pos 1 > 0
+7(6) 
+FAIL testing Blob.getBytes() with pos 1 > 0
+testing Blob.getBytes() with pos 9905 > 5000
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 5000
+Known JCC Bug 5914
+testing Blob.getBytes() with pos 5910 > 5000
+Known JCC Bug 5914
+8(3) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(4) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+8(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(6) w
+8(7) 
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(0) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(1) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(2) I-am-hiding-here-at-position-5910-in-this-humungus
+9(3) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(4) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+9(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(6) w
+9(7) 
+wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+blobTest2 finished
+Found horse in row 2 starting from position 1 at position 16
+Found ouch in row 3 starting from position 1 at position 23
+Found 
+ in row 4 starting from position 1 at position 32
+Found 
+ in row 5 starting from position 1 at position 56
+Found 
+ in row 6 starting from position 1 at position 100
+Found Beginning in row 6 starting from position 1 at position 1
+Found position-69 in row 6 starting from position 1 at position 69
+Found This-is-position-204 in row 6 starting from position 1 at position 204
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 1 at position 5910
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 5910 at position 5910
+Found Position-9907 in row 6 starting from position 1 at position 9907
+Found 
+ in row 8 starting from position 1 at position 100
+blobTest3 finished
+searchBlob row 13 skipped (too large)
+Found horse in row 2 at position 16
+searchBlob row 13 skipped (too large)
+Found ouch in row 3 at position 23
+searchBlob row 13 skipped (too large)
+Found 
+ in row 4 at position 32
+searchBlob row 13 skipped (too large)
+Found 
+ in row 5 at position 56
+Found test data: a string column inserted as an Ascii stream
+ in row 5 at position 1
+searchBlob row 13 skipped (too large)
+Found 
+ in row 6 at position 100
+Found Beginning in row 6 at position 1
+Found position-69 in row 6 at position 69
+Found I-am-hiding-here-at-position-5910 in row 6 at position 5910
+Found Position-9907 in row 6 at position 9907
+Found blob (row 10)  in row 6 at position 1
+Found blob (row 12)  in row 6 at position 301
+searchBlob row 13 skipped (too large)
+searchBlob row 13 skipped (too large)
+Found 
+ in row 8 at position 100
+Found blob (row 12)  in row 8 at position 1
+searchBlob row 13 skipped (too large)
+testBlob row 9 skipped (too large)
+blobTest4 finished
+blobTest51 finished
+EXPECTED SQLSTATE(null): Invalid data conversion: Wrong result column type for requested conversion.
+blobTest53 finished
+EXPECTED SQLSTATE(XCL12): An attempt was made to put a data value of type 'byte[]' into a data value of type 'INTEGER'.
+EXPECTED SQLSTATE(null): Invalid position 0 or length 5
+EXPECTED SQLSTATE(null): Invalid position 1 or length -76
+EXPECTED SQLSTATE(null): Search pattern cannot be null.
+EXPECTED SQLSTATE(null): Search pattern cannot be null.
+blobTest6 finished
+blobTest7 finished
+done row 0, length was 0
+done row 1, length was 65
+done row 2, length was 26
+done row 3, length was 42
+done row 4, length was 56
+done row 5, length was 10000
+done row 6, length was 0
+done row 7, length was 5000
+done row 8, length was 300000
+row 9 is null, skipped
+blobTest91 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(40XL1): A lock could not be obtained within the time requested
+blobTest93 finished
+shortBlob length after commit is 26
+blobTest94 finished
+EXPECTED SQLSTATE(null): Lob method called after connection was closed
+EXPECTED SQLSTATE(null): Lob method called after connection was closed
+EXPECTED SQLSTATE(null): Lob method called after connection was closed
+EXPECTED SQLSTATE(null): Lob method called after connection was closed
+EXPECTED SQLSTATE(null): Lob method called after connection was closed
+EXPECTED SQLSTATE(null): Lob method called after connection was closed
+blobTest95 finished
+blobTest96 finished
+length of clob chosen is 10000
+After update
+Row 1 value.substring(0,50) is jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+10000 total bytes read
+clobTestSelfDestructive finished
+length of clob chosen is 10000
+After drop
+Expect to get an IOException, container has been closed
+10000 total bytes read
+clobTestSelfDestructive2 finished
+FINISHED TEST blobclob :-)
+Test blobclob finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/characterStreams.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/characterStreams.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/characterStreams.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+SKIP TEST FOR NOW

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/dbMetaDataJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,31 @@
+Test dbMetaDataJdbc30 starting
+JDBC Driver 'IBM DB2 JDBC Universal Driver Architecture', version (EXPECTED VERSION)
+The URL is: jdbc:derby:net://localhost:1527/wombat;create=true
+supportsSavepoints() : true
+supportsNamedParameters() : false
+supportsMultipleOpenResults() : true
+supportsGetGeneratedKeys() : false
+supportsResultSetHoldability(HOLD_CURSORS_OVER_COMMIT) : true
+supportsResultSetHoldability(CLOSE_CURSORS_AT_COMMIT) : true
+getJDBCMajorVersion() : 3
+getJDBCMinorVersion() : 0
+getSQLStateType() : 2
+getResultSetHoldability() : 1
+getDatabaseMajorVersion() : 10
+getDatabaseMinorVersion() : 1
+supportsStatementPooling() : false
+getMaxColumnNameLength() = 30
+getMaxCursorNameLength() = 18
+getMaxSchemaNameLength() = 30
+getMaxProcedureNameLength() = 128
+getMaxTableNameLength() = 128
+getMaxUserNameLength() = 30
+getSuperTypes() with null :
+EXPECTED: Not Implemented Exception or empty  ResultSet
+getSuperTables() with null :
+EXPECTED: Not Implemented Exception or empty  ResultSet
+getAttributes() with null :
+EXPECTED: Not Implemented Exception or empty  ResultSet
+locatorsUpdateCopy(): 
+Returned: true
+Test dbMetaDataJdbc30 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/getCurConnJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/getCurConnJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/getCurConnJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,22 @@
+ij> -- test getCurConnJdbc20
+----- this test will get run under jdk12 only. If run under jdk11x, will get an exception like
+----- following for call to newToJdbc20Method
+----- ERROR 38000: The exception 'java.lang.NoSuchMethodError: java.sql.Connection: method 
+----- createStatement(II)Ljava/sql/Statement; not found' was thrown while evaluating an expression.
+----- method alias and table used later
+create procedure newToJdbc20Method() PARAMETER STYLE JAVA LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Jdbc20Test.newToJdbc20Method';
+0 rows inserted/updated/deleted
+ij> create table T (a int NOT NULL primary key);
+0 rows inserted/updated/deleted
+ij> insert into T values (1);
+1 row inserted/updated/deleted
+ij> -- now lets try a variety of errors
+call newToJdbc20Method();
+Statement executed.
+ij> ------------------------------------------------------------
+----- drop the table
+drop table T;
+0 rows inserted/updated/deleted
+ij> drop procedure newToJdbc20Method;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/maxfieldsize.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/maxfieldsize.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/maxfieldsize.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,893 @@
+Test MaxFieldSize  starting
+Iteration #: 0
+Max Field Size = 0
+Column #: 1
+getObject(1)
+  as byte[] length 100
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getObject(2)
+  as byte[] length 43
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getObject(3)
+  as byte[] length 43
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+getObject(4)
+  as String
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+Column #: 5
+getObject(5)
+  as String
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+getObject(6)
+  as String
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 1
+Max Field Size = 0
+Column #: 1
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(1) length 200
+43315858585858585858585858585858585858585858585858585858585858585858585858585858585858202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020
+Column #: 2
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(2) length 86
+43325858585858585858585858585858585858585858585858585858585858585858585858585858585858
+Column #: 3
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(3) length 86
+43335858585858585858585858585858585858585858585858585858585858585858585858585858585858
+Column #: 4
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(4) length 100
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+Column #: 5
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(5) length 45
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(6) length 46
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 2
+Max Field Size = 0
+Column #: 1
+getAsciiStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getAsciiStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getAsciiStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+getAsciiStream(4)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 5
+getAsciiStream(5)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #: 6
+getAsciiStream(6)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 3
+Max Field Size = 0
+Column #: 1
+getBinaryStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getBinaryStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getBinaryStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Iteration #: 4
+Max Field Size = 0
+Column #: 1
+getBytes(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getBytes(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getBytes(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Iteration #: 5
+Max Field Size = 24
+Column #: 1
+getObject(1)
+  as byte[] length 24
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getObject(2)
+  as byte[] length 24
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getObject(3)
+  as byte[] length 24
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+getObject(4)
+  as String
+C4XXXXXXXXXXXXXXXXXXXXXX
+Column #: 5
+getObject(5)
+  as String
+C5XXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+getObject(6)
+  as String
+C6XXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 6
+Max Field Size = 24
+Column #: 1
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(1) length 24
+433158585858585858585858
+Column #: 2
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(2) length 24
+433258585858585858585858
+Column #: 3
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(3) length 24
+433358585858585858585858
+Column #: 4
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(4) length 24
+C4XXXXXXXXXXXXXXXXXXXXXX
+Column #: 5
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(5) length 24
+C5XXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+beetle 5350 - JCC returns incorrect result for maxfieldsize()
+getString(6) length 24
+C6XXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 7
+Max Field Size = 24
+Column #: 1
+getAsciiStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getAsciiStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getAsciiStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+getAsciiStream(4)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 5
+getAsciiStream(5)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 6
+getAsciiStream(6)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 8
+Max Field Size = 24
+Column #: 1
+getBinaryStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getBinaryStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getBinaryStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Iteration #: 9
+Max Field Size = 24
+Column #: 1
+getBytes(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getBytes(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getBytes(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Expected Exception - Invalid maxFieldsize
+Doing external sort
+Max Field Size = 0
+Iteration #: 0
+Column #1: 4999
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 1
+Column #1: 4998
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 2
+Column #1: 4997
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 3
+Column #1: 4996
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4
+Column #1: 4995
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4995
+Column #1: 4
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4996
+Column #1: 3
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4997
+Column #1: 2
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4998
+Column #1: 1
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4999
+Column #1: 0
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Max Field Size = 24
+Iteration #: 0
+Column #1: 4999
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 1
+Column #1: 4998
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 2
+Column #1: 4997
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 3
+Column #1: 4996
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4
+Column #1: 4995
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4995
+Column #1: 4
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4996
+Column #1: 3
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4997
+Column #1: 2
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4998
+Column #1: 1
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4999
+Column #1: 0
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Test maxfieldsize  finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,14 @@
+Test metadataJdbc20 starting
+JDBC Driver 'IBM DB2 JDBC Universal Driver Architecture', version (EXPECTED VERSION)
+The URL is: jdbc:derby:net://localhost:1527/wombat;create=true
+getUDTs() with user-named types null :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('JAVA_OBJECT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('STRUCT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('DISTINCT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('JAVA_OBJECT', 'STRUCT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+Test metadataJdbc20 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/prepStmtMetaData.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/prepStmtMetaData.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/prepStmtMetaData.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,26 @@
+Test prepStmtMetaData starting
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+Result meta data for select
+A,B
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+bug 4579 and 5338 : Result meta data for select *
+C11
+bug 4579 and 5338 : Result meta data for select * after alter table but w/o execute query
+C11
+bug 4579 and 5338 : Result meta data for select * after alter table and execute query
+C11
+Test prepStmtMetaData finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1014 @@
+Test resultset starting
+getColumnCount(): 16
+isAutoIncrement(1): false
+isCaseSensitive(1): false
+isSearchable(1): true
+isCurrency(1): false
+isNullable(1): 1
+isSigned(1): true
+getColumnDisplaySize(1): 11
+getColumnLabel(1): I
+getColumnName(1): I
+getTableName(1): T
+getSchemaName(1): 
+getCatalogName(1): 
+getColumnType(1): 4
+getPrecision(1): 10
+getScale(1): 0
+getColumnTypeName(1): INTEGER
+isReadOnly(1): true
+isDefinitelyWritable(1): false
+isAutoIncrement(2): false
+isCaseSensitive(2): false
+isSearchable(2): true
+isCurrency(2): false
+isNullable(2): 1
+isSigned(2): true
+getColumnDisplaySize(2): 6
+getColumnLabel(2): S
+getColumnName(2): S
+getTableName(2): T
+getSchemaName(2): 
+getCatalogName(2): 
+getColumnType(2): 5
+getPrecision(2): 5
+getScale(2): 0
+getColumnTypeName(2): SMALLINT
+isReadOnly(2): true
+isDefinitelyWritable(2): false
+isAutoIncrement(3): false
+isCaseSensitive(3): false
+isSearchable(3): true
+isCurrency(3): false
+isNullable(3): 1
+isSigned(3): true
+getColumnDisplaySize(3): 13
+getColumnLabel(3): R
+getColumnName(3): R
+getTableName(3): T
+getSchemaName(3): 
+getCatalogName(3): 
+getColumnType(3): 7
+getPrecision(3): 7
+getScale(3): 0
+getColumnTypeName(3): REAL
+isReadOnly(3): true
+isDefinitelyWritable(3): false
+isAutoIncrement(4): false
+isCaseSensitive(4): false
+isSearchable(4): true
+isCurrency(4): false
+isNullable(4): 1
+isSigned(4): true
+getColumnDisplaySize(4): 22
+getColumnLabel(4): D
+getColumnName(4): D
+getTableName(4): T
+getSchemaName(4): 
+getCatalogName(4): 
+getColumnType(4): 8
+getPrecision(4): 15
+getScale(4): 0
+getColumnTypeName(4): DOUBLE
+isReadOnly(4): true
+isDefinitelyWritable(4): false
+isAutoIncrement(5): false
+isCaseSensitive(5): false
+isSearchable(5): true
+isCurrency(5): false
+isNullable(5): 1
+isSigned(5): false
+getColumnDisplaySize(5): 10
+getColumnLabel(5): DT
+getColumnName(5): DT
+getTableName(5): T
+getSchemaName(5): 
+getCatalogName(5): 
+getColumnType(5): 91
+getPrecision(5): 10
+getScale(5): 0
+getColumnTypeName(5): DATE
+isReadOnly(5): true
+isDefinitelyWritable(5): false
+isAutoIncrement(6): false
+isCaseSensitive(6): false
+isSearchable(6): true
+isCurrency(6): false
+isNullable(6): 1
+isSigned(6): false
+getColumnDisplaySize(6): 8
+getColumnLabel(6): T
+getColumnName(6): T
+getTableName(6): T
+getSchemaName(6): 
+getCatalogName(6): 
+getColumnType(6): 92
+getPrecision(6): 8
+getScale(6): 0
+getColumnTypeName(6): TIME
+isReadOnly(6): true
+isDefinitelyWritable(6): false
+isAutoIncrement(7): false
+isCaseSensitive(7): false
+isSearchable(7): true
+isCurrency(7): false
+isNullable(7): 1
+isSigned(7): false
+getColumnDisplaySize(7): 26
+getColumnLabel(7): TS
+getColumnName(7): TS
+getTableName(7): T
+getSchemaName(7): 
+getCatalogName(7): 
+getColumnType(7): 93
+getPrecision(7): 26
+getScale(7): 6
+getColumnTypeName(7): TIMESTAMP
+isReadOnly(7): true
+isDefinitelyWritable(7): false
+isAutoIncrement(8): false
+isCaseSensitive(8): true
+isSearchable(8): true
+isCurrency(8): false
+isNullable(8): 1
+isSigned(8): false
+getColumnDisplaySize(8): 10
+getColumnLabel(8): C
+getColumnName(8): C
+getTableName(8): T
+getSchemaName(8): 
+getCatalogName(8): 
+getColumnType(8): 1
+getPrecision(8): 10
+getScale(8): 0
+getColumnTypeName(8): CHAR
+isReadOnly(8): true
+isDefinitelyWritable(8): false
+isAutoIncrement(9): false
+isCaseSensitive(9): true
+isSearchable(9): true
+isCurrency(9): false
+isNullable(9): 0
+isSigned(9): false
+getColumnDisplaySize(9): 40
+getColumnLabel(9): V
+getColumnName(9): V
+getTableName(9): T
+getSchemaName(9): 
+getCatalogName(9): 
+getColumnType(9): 12
+getPrecision(9): 40
+getScale(9): 0
+getColumnTypeName(9): VARCHAR
+isReadOnly(9): true
+isDefinitelyWritable(9): false
+isAutoIncrement(10): false
+isCaseSensitive(10): false
+isSearchable(10): true
+isCurrency(10): false
+isNullable(10): 1
+isSigned(10): true
+getColumnDisplaySize(10): 12
+getColumnLabel(10): DC
+getColumnName(10): DC
+getTableName(10): T
+getSchemaName(10): 
+getCatalogName(10): 
+getColumnType(10): 3
+getPrecision(10): 10
+getScale(10): 2
+getColumnTypeName(10): DECIMAL
+isReadOnly(10): true
+isDefinitelyWritable(10): false
+isAutoIncrement(11): false
+isCaseSensitive(11): false
+isSearchable(11): true
+isCurrency(11): false
+isNullable(11): 1
+isSigned(11): true
+getColumnDisplaySize(11): 20
+getColumnLabel(11): BI
+getColumnName(11): BI
+getTableName(11): T
+getSchemaName(11): 
+getCatalogName(11): 
+getColumnType(11): -5
+getPrecision(11): 19
+getScale(11): 0
+getColumnTypeName(11): BIGINT
+isReadOnly(11): true
+isDefinitelyWritable(11): false
+isAutoIncrement(12): false
+isCaseSensitive(12): false
+isSearchable(12): true
+isCurrency(12): false
+isNullable(12): 1
+isSigned(12): false
+getColumnDisplaySize(12): 20
+getColumnLabel(12): CBD
+getColumnName(12): CBD
+getTableName(12): T
+getSchemaName(12): 
+getCatalogName(12): 
+getColumnType(12): -2
+getPrecision(12): 10
+getScale(12): 0
+getColumnTypeName(12): CHAR FOR BIT DATA
+isReadOnly(12): true
+isDefinitelyWritable(12): false
+isAutoIncrement(13): false
+isCaseSensitive(13): false
+isSearchable(13): true
+isCurrency(13): false
+isNullable(13): 1
+isSigned(13): false
+getColumnDisplaySize(13): 20
+getColumnLabel(13): VBD
+getColumnName(13): VBD
+getTableName(13): T
+getSchemaName(13): 
+getCatalogName(13): 
+getColumnType(13): -3
+getPrecision(13): 10
+getScale(13): 0
+getColumnTypeName(13): VARCHAR FOR BIT DATA
+isReadOnly(13): true
+isDefinitelyWritable(13): false
+isAutoIncrement(14): false
+isCaseSensitive(14): false
+isSearchable(14): true
+isCurrency(14): false
+isNullable(14): 1
+isSigned(14): false
+getColumnDisplaySize(14): 65400
+getColumnLabel(14): LVBD
+getColumnName(14): LVBD
+getTableName(14): T
+getSchemaName(14): 
+getCatalogName(14): 
+getColumnType(14): -4
+getPrecision(14): 32700
+getScale(14): 0
+getColumnTypeName(14): LONG VARCHAR FOR BIT DATA
+isReadOnly(14): true
+isDefinitelyWritable(14): false
+isAutoIncrement(15): false
+isCaseSensitive(15): true
+isSearchable(15): true
+isCurrency(15): false
+isNullable(15): 1
+isSigned(15): false
+getColumnDisplaySize(15): 2147483647
+getColumnLabel(15): CL
+getColumnName(15): CL
+getTableName(15): T
+getSchemaName(15): 
+getCatalogName(15): 
+getColumnType(15): 2005
+getPrecision(15): 2147483647
+getScale(15): 0
+getColumnTypeName(15): CLOB
+isReadOnly(15): true
+isDefinitelyWritable(15): false
+isAutoIncrement(16): false
+isCaseSensitive(16): false
+isSearchable(16): true
+isCurrency(16): false
+isNullable(16): 1
+isSigned(16): false
+getColumnDisplaySize(16): -2147483648
+getColumnLabel(16): BL
+getColumnName(16): BL
+getTableName(16): T
+getSchemaName(16): 
+getCatalogName(16): 
+getColumnType(16): 2004
+getPrecision(16): 1073741824
+getScale(16): 0
+getColumnTypeName(16): BLOB
+isReadOnly(16): true
+isDefinitelyWritable(16): false
+getBigDecimal(1,1): 1.0
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(i,1): 1.0
+getBoolean(1): true
+getBoolean(i): true
+getByte(1): 1
+getByte(i): 1
+getBytes(1) got exception 
+Data Conversion SQLException
+getBytes(i) got exception 
+Data Conversion SQLException
+getDate(1) got exception 
+Data Conversion SQLException
+getDate(i) got exception 
+Data Conversion SQLException
+getDouble(1): 1.0
+getDouble(i): 1.0
+getFloat(1): 1.0
+getFloat(i): 1.0
+getInt(1): 1
+getInt(i): 1
+getLong(1): 1
+getLong(i): 1
+getObject(1): 1
+getObject(i): 1
+getShort(1): 1
+getShort(i): 1
+getString(1): 1
+getString(i): 1
+getTime(1) got exception 
+Data Conversion SQLException
+getTime(i) got exception 
+Data Conversion SQLException
+getTimestamp(1) got exception 
+Data Conversion SQLException
+getTimestamp(i) got exception 
+Data Conversion SQLException
+getBigDecimal(2,1): 2.0
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(s,1): 2.0
+getBoolean(2): true
+getBoolean(s): true
+getByte(2): 2
+getByte(s): 2
+getBytes(2) got exception 
+Data Conversion SQLException
+getBytes(s) got exception 
+Data Conversion SQLException
+getDate(2) got exception 
+Data Conversion SQLException
+getDate(s) got exception 
+Data Conversion SQLException
+getDouble(2): 2.0
+getDouble(s): 2.0
+getFloat(2): 2.0
+getFloat(s): 2.0
+getInt(2): 2
+getInt(s): 2
+getLong(2): 2
+getLong(s): 2
+getObject(2): 2
+getObject(s): 2
+getShort(2): 2
+getShort(s): 2
+getString(2): 2
+getString(s): 2
+getTime(2) got exception 
+Data Conversion SQLException
+getTime(s) got exception 
+Data Conversion SQLException
+getTimestamp(2) got exception 
+Data Conversion SQLException
+getTimestamp(s) got exception 
+Data Conversion SQLException
+getBigDecimal(3,1): 3.3
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(r,1): 3.3
+getBoolean(3): true
+getBoolean(r): true
+getByte(3): 3
+getByte(r): 3
+getBytes(3) got exception 
+Data Conversion SQLException
+getBytes(r) got exception 
+Data Conversion SQLException
+getDate(3) got exception 
+Data Conversion SQLException
+getDate(r) got exception 
+Data Conversion SQLException
+getDouble(3): 3.299999952316284
+getDouble(r): 3.299999952316284
+getFloat(3): 3.3
+getFloat(r): 3.3
+getInt(3): 3
+getInt(r): 3
+getLong(3): 3
+getLong(r): 3
+getObject(3): 3.3
+getObject(r): 3.3
+getShort(3): 3
+getShort(r): 3
+getString(3): 3.3
+getString(r): 3.3
+getTime(3) got exception 
+Data Conversion SQLException
+getTime(r) got exception 
+Data Conversion SQLException
+getTimestamp(3) got exception 
+Data Conversion SQLException
+getTimestamp(r) got exception 
+Data Conversion SQLException
+getBigDecimal(4,1): 4.4
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(d,1): 4.4
+getBoolean(4): true
+getBoolean(d): true
+getByte(4): 4
+getByte(d): 4
+getBytes(4) got exception 
+Data Conversion SQLException
+getBytes(d) got exception 
+Data Conversion SQLException
+getDate(4) got exception 
+Data Conversion SQLException
+getDate(d) got exception 
+Data Conversion SQLException
+getDouble(4): 4.4
+getDouble(d): 4.4
+getFloat(4): 4.4
+getFloat(d): 4.4
+getInt(4): 4
+getInt(d): 4
+getLong(4): 4
+getLong(d): 4
+getObject(4): 4.4
+getObject(d): 4.4
+getShort(4): 4
+getShort(d): 4
+getString(4): 4.4
+getString(d): 4.4
+getTime(4) got exception 
+Data Conversion SQLException
+getTime(d) got exception 
+Data Conversion SQLException
+getTimestamp(4) got exception 
+Data Conversion SQLException
+getTimestamp(d) got exception 
+Data Conversion SQLException
+getBigDecimal(5,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(dt,1) got exception 
+Data Conversion SQLException
+getBoolean(5) got exception 
+Data Conversion SQLException
+getBoolean(dt) got exception 
+Data Conversion SQLException
+getByte(5) got exception 
+Data Conversion SQLException
+getByte(dt) got exception 
+Data Conversion SQLException
+getBytes(5) got exception 
+Data Conversion SQLException
+getBytes(dt) got exception 
+Data Conversion SQLException
+getDate(5): 1990-05-05
+getDate(dt): 1990-05-05
+getDouble(5) got exception 
+Data Conversion SQLException
+getDouble(dt) got exception 
+Data Conversion SQLException
+getFloat(5) got exception 
+Data Conversion SQLException
+getFloat(dt) got exception 
+Data Conversion SQLException
+getInt(5) got exception 
+Data Conversion SQLException
+getInt(dt) got exception 
+Data Conversion SQLException
+getLong(5) got exception 
+Data Conversion SQLException
+getLong(dt) got exception 
+Data Conversion SQLException
+getObject(5): 1990-05-05
+getObject(dt): 1990-05-05
+getShort(5) got exception 
+Data Conversion SQLException
+getShort(dt) got exception 
+Data Conversion SQLException
+getString(5): 1990-05-05
+getString(dt): 1990-05-05
+getTime(5) got exception 
+Data Conversion SQLException
+getTime(dt) got exception 
+Data Conversion SQLException
+getTimestamp(5): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTimestamp(dt): xxxxxxFILTERED-TIMESTAMPxxxxx
+getBigDecimal(6,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(t,1) got exception 
+Data Conversion SQLException
+getBoolean(6) got exception 
+Data Conversion SQLException
+getBoolean(t) got exception 
+Data Conversion SQLException
+getByte(6) got exception 
+Data Conversion SQLException
+getByte(t) got exception 
+Data Conversion SQLException
+getBytes(6) got exception 
+Data Conversion SQLException
+getBytes(t) got exception 
+Data Conversion SQLException
+getDate(6) got exception 
+Data Conversion SQLException
+getDate(t) got exception 
+Data Conversion SQLException
+getDouble(6) got exception 
+Data Conversion SQLException
+getDouble(t) got exception 
+Data Conversion SQLException
+getFloat(6) got exception 
+Data Conversion SQLException
+getFloat(t) got exception 
+Data Conversion SQLException
+getInt(6) got exception 
+Data Conversion SQLException
+getInt(t) got exception 
+Data Conversion SQLException
+getLong(6) got exception 
+Data Conversion SQLException
+getLong(t) got exception 
+Data Conversion SQLException
+getObject(6): 12:06:06
+getObject(t): 12:06:06
+getShort(6) got exception 
+Data Conversion SQLException
+getShort(t) got exception 
+Data Conversion SQLException
+getString(6): 12:06:06
+getString(t): 12:06:06
+getTime(6): 12:06:06
+getTime(t): 12:06:06
+getTimestamp(6): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTimestamp(t): xxxxxxFILTERED-TIMESTAMPxxxxx
+getBigDecimal(7,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(ts,1) got exception 
+Data Conversion SQLException
+getBoolean(7) got exception 
+Data Conversion SQLException
+getBoolean(ts) got exception 
+Data Conversion SQLException
+getByte(7) got exception 
+Data Conversion SQLException
+getByte(ts) got exception 
+Data Conversion SQLException
+getBytes(7) got exception 
+Data Conversion SQLException
+getBytes(ts) got exception 
+Data Conversion SQLException
+getDate(7): 1990-07-07
+getDate(ts): 1990-07-07
+getDouble(7) got exception 
+Data Conversion SQLException
+getDouble(ts) got exception 
+Data Conversion SQLException
+getFloat(7) got exception 
+Data Conversion SQLException
+getFloat(ts) got exception 
+Data Conversion SQLException
+getInt(7) got exception 
+Data Conversion SQLException
+getInt(ts) got exception 
+Data Conversion SQLException
+getLong(7) got exception 
+Data Conversion SQLException
+getLong(ts) got exception 
+Data Conversion SQLException
+getObject(7): xxxxxxFILTERED-TIMESTAMPxxxxx
+getObject(ts): xxxxxxFILTERED-TIMESTAMPxxxxx
+getShort(7) got exception 
+Data Conversion SQLException
+getShort(ts) got exception 
+Data Conversion SQLException
+getString(7): xxxxxxFILTERED-TIMESTAMPxxxxx
+getString(ts): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTime(7): 07:07:07
+getTime(ts): 07:07:07
+getTimestamp(7): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTimestamp(ts): xxxxxxFILTERED-TIMESTAMPxxxxx
+getBigDecimal(8,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(c,1) got exception 
+Data Conversion SQLException
+getBoolean(8): true
+getBoolean(c): true
+getByte(8) got exception 
+Data Conversion SQLException
+getByte(c) got exception 
+Data Conversion SQLException
+getBytes(8) got exception 
+Data Conversion SQLException
+getBytes(c) got exception 
+Data Conversion SQLException
+getDate(8) got exception 
+Data Conversion SQLException
+getDate(c) got exception 
+Data Conversion SQLException
+getDouble(8) got exception 
+Data Conversion SQLException
+getDouble(c) got exception 
+Data Conversion SQLException
+getFloat(8) got exception 
+Data Conversion SQLException
+getFloat(c) got exception 
+Data Conversion SQLException
+getInt(8) got exception 
+Data Conversion SQLException
+getInt(c) got exception 
+Data Conversion SQLException
+getLong(8) got exception 
+Data Conversion SQLException
+getLong(c) got exception 
+Data Conversion SQLException
+getObject(8): eight     
+getObject(c): eight     
+getShort(8) got exception 
+Data Conversion SQLException
+getShort(c) got exception 
+Data Conversion SQLException
+getString(8): eight     
+getString(c): eight     
+getTime(8) got exception 
+Data Conversion SQLException
+getTime(c) got exception 
+Data Conversion SQLException
+getTimestamp(8) got exception 
+Data Conversion SQLException
+getTimestamp(c) got exception 
+Data Conversion SQLException
+getBigDecimal(9,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(v,1) got exception 
+Data Conversion SQLException
+getBoolean(9): true
+getBoolean(v): true
+getByte(9) got exception 
+Data Conversion SQLException
+getByte(v) got exception 
+Data Conversion SQLException
+getBytes(9) got exception 
+Data Conversion SQLException
+getBytes(v) got exception 
+Data Conversion SQLException
+getDate(9) got exception 
+Data Conversion SQLException
+getDate(v) got exception 
+Data Conversion SQLException
+getDouble(9) got exception 
+Data Conversion SQLException
+getDouble(v) got exception 
+Data Conversion SQLException
+getFloat(9) got exception 
+Data Conversion SQLException
+getFloat(v) got exception 
+Data Conversion SQLException
+getInt(9) got exception 
+Data Conversion SQLException
+getInt(v) got exception 
+Data Conversion SQLException
+getLong(9) got exception 
+Data Conversion SQLException
+getLong(v) got exception 
+Data Conversion SQLException
+getObject(9): nine
+getObject(v): nine
+getShort(9) got exception 
+Data Conversion SQLException
+getShort(v) got exception 
+Data Conversion SQLException
+getString(9): nine
+getString(v): nine
+getTime(9) got exception 
+Data Conversion SQLException
+getTime(v) got exception 
+Data Conversion SQLException
+getTimestamp(9) got exception 
+Data Conversion SQLException
+getTimestamp(v) got exception 
+Data Conversion SQLException
+getBigDecimal(10,1): 10.1
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(dc,1): 10.1
+getBoolean(10): true
+getBoolean(dc): true
+getByte(10): 10
+getByte(dc): 10
+getBytes(10) got exception 
+Data Conversion SQLException
+getBytes(dc) got exception 
+Data Conversion SQLException
+getDate(10) got exception 
+Data Conversion SQLException
+getDate(dc) got exception 
+Data Conversion SQLException
+getDouble(10): 10.1
+getDouble(dc): 10.1
+getFloat(10): 10.1
+getFloat(dc): 10.1
+getInt(10): 10
+getInt(dc): 10
+getLong(10): 10
+getLong(dc): 10
+getObject(10): 10.10
+getObject(dc): 10.10
+getShort(10): 10
+getShort(dc): 10
+getString(10): 10.10
+getString(dc): 10.10
+getTime(10) got exception 
+Data Conversion SQLException
+getTime(dc) got exception 
+Data Conversion SQLException
+getTimestamp(10) got exception 
+Data Conversion SQLException
+getTimestamp(dc) got exception 
+Data Conversion SQLException
+getBigDecimal(11,1): 11.0
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(bi,1): 11.0
+getBoolean(11): true
+getBoolean(bi): true
+getByte(11): 11
+getByte(bi): 11
+getBytes(11) got exception 
+Data Conversion SQLException
+getBytes(bi) got exception 
+Data Conversion SQLException
+getDate(11) got exception 
+Data Conversion SQLException
+getDate(bi) got exception 
+Data Conversion SQLException
+getDouble(11): 11.0
+getDouble(bi): 11.0
+getFloat(11): 11.0
+getFloat(bi): 11.0
+getInt(11): 11
+getInt(bi): 11
+getLong(11): 11
+getLong(bi): 11
+getObject(11): 11
+getObject(bi): 11
+getShort(11): 11
+getShort(bi): 11
+getString(11): 11
+getString(bi): 11
+getTime(11) got exception 
+Data Conversion SQLException
+getTime(bi) got exception 
+Data Conversion SQLException
+getTimestamp(11) got exception 
+Data Conversion SQLException
+getTimestamp(bi) got exception 
+Data Conversion SQLException
+getBigDecimal(12,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(cbd,1) got exception 
+Data Conversion SQLException
+getBoolean(12) got exception 
+Data Conversion SQLException
+getBoolean(cbd) got exception 
+Data Conversion SQLException
+getByte(12) got exception 
+Data Conversion SQLException
+getByte(cbd) got exception 
+Data Conversion SQLException
+getBytes(12): 0x007400770065006C0076
+getBytes(cbd): 0x007400770065006C0076
+getDate(12) got exception 
+Data Conversion SQLException
+getDate(cbd) got exception 
+Data Conversion SQLException
+getDouble(12) got exception 
+Data Conversion SQLException
+getDouble(cbd) got exception 
+Data Conversion SQLException
+getFloat(12) got exception 
+Data Conversion SQLException
+getFloat(cbd) got exception 
+Data Conversion SQLException
+getInt(12) got exception 
+Data Conversion SQLException
+getInt(cbd) got exception 
+Data Conversion SQLException
+getLong(12) got exception 
+Data Conversion SQLException
+getLong(cbd) got exception 
+Data Conversion SQLException
+getObject(12) is ok
+getObject(cbd) is ok 
+getShort(12) got exception 
+Data Conversion SQLException
+getShort(cbd) got exception 
+Data Conversion SQLException
+getString(12): 007400770065006c0076
+getString(cbd): 007400770065006c0076
+getTime(12) got exception 
+Data Conversion SQLException
+getTime(cbd) got exception 
+Data Conversion SQLException
+getTimestamp(12) got exception 
+Data Conversion SQLException
+getTimestamp(cbd) got exception 
+Data Conversion SQLException
+getBigDecimal(13,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(vbd,1) got exception 
+Data Conversion SQLException
+getBoolean(13) got exception 
+Data Conversion SQLException
+getBoolean(vbd) got exception 
+Data Conversion SQLException
+getByte(13) got exception 
+Data Conversion SQLException
+getByte(vbd) got exception 
+Data Conversion SQLException
+getBytes(13): 0x0033007400650065006E
+getBytes(vbd): 0x0033007400650065006E
+getDate(13) got exception 
+Data Conversion SQLException
+getDate(vbd) got exception 
+Data Conversion SQLException
+getDouble(13) got exception 
+Data Conversion SQLException
+getDouble(vbd) got exception 
+Data Conversion SQLException
+getFloat(13) got exception 
+Data Conversion SQLException
+getFloat(vbd) got exception 
+Data Conversion SQLException
+getInt(13) got exception 
+Data Conversion SQLException
+getInt(vbd) got exception 
+Data Conversion SQLException
+getLong(13) got exception 
+Data Conversion SQLException
+getLong(vbd) got exception 
+Data Conversion SQLException
+getObject(13) is ok
+getObject(vbd) is ok 
+getShort(13) got exception 
+Data Conversion SQLException
+getShort(vbd) got exception 
+Data Conversion SQLException
+getString(13): 0033007400650065006e
+getString(vbd): 0033007400650065006e
+getTime(13) got exception 
+Data Conversion SQLException
+getTime(vbd) got exception 
+Data Conversion SQLException
+getTimestamp(13) got exception 
+Data Conversion SQLException
+getTimestamp(vbd) got exception 
+Data Conversion SQLException
+getBigDecimal(14,1) got exception 
+Data Conversion SQLException
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(lvbd,1) got exception 
+Data Conversion SQLException
+getBoolean(14) got exception 
+Data Conversion SQLException
+getBoolean(lvbd) got exception 
+Data Conversion SQLException
+getByte(14) got exception 
+Data Conversion SQLException
+getByte(lvbd) got exception 
+Data Conversion SQLException
+getBytes(14): 0x0034007400650065006E
+getBytes(lvbd): 0x0034007400650065006E
+getDate(14) got exception 
+Data Conversion SQLException
+getDate(lvbd) got exception 
+Data Conversion SQLException
+getDouble(14) got exception 
+Data Conversion SQLException
+getDouble(lvbd) got exception 
+Data Conversion SQLException
+getFloat(14) got exception 
+Data Conversion SQLException
+getFloat(lvbd) got exception 
+Data Conversion SQLException
+getInt(14) got exception 
+Data Conversion SQLException
+getInt(lvbd) got exception 
+Data Conversion SQLException
+getLong(14) got exception 
+Data Conversion SQLException
+getLong(lvbd) got exception 
+Data Conversion SQLException
+getObject(14) is ok
+getObject(lvbd) is ok 
+getShort(14) got exception 
+Data Conversion SQLException
+getShort(lvbd) got exception 
+Data Conversion SQLException
+getString(14): 0034007400650065006e
+getString(lvbd): 0034007400650065006e
+getTime(14) got exception 
+Data Conversion SQLException
+getTime(lvbd) got exception 
+Data Conversion SQLException
+getTimestamp(14) got exception 
+Data Conversion SQLException
+getTimestamp(lvbd) got exception 
+Data Conversion SQLException
+getBigDecimal(15,1): null
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(cl,1): null
+getBoolean(15): false
+getBoolean(cl): false
+getByte(15): 0
+getByte(cl): 0
+getBytes(15): null
+getBytes(cl): null
+getDate(15): null
+getDate(cl): null
+getDouble(15): 0.0
+getDouble(cl): 0.0
+getFloat(15): 0.0
+getFloat(cl): 0.0
+getInt(15): 0
+getInt(cl): 0
+getLong(15): 0
+getLong(cl): 0
+getObject(15) is ok
+getObject(cl) is ok 
+getShort(15): 0
+getShort(cl): 0
+getString(15): null
+getString(cl): null
+getTime(15): null
+getTime(cl): null
+getTimestamp(15): null
+getTimestamp(cl): null
+getBigDecimal(16,1): null
+beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)
+getBigDecimal(bl,1): null
+getBoolean(16): false
+getBoolean(bl): false
+getByte(16): 0
+getByte(bl): 0
+getBytes(16): null
+getBytes(bl): null
+getDate(16): null
+getDate(bl): null
+getDouble(16): 0.0
+getDouble(bl): 0.0
+getFloat(16): 0.0
+getFloat(bl): 0.0
+getInt(16): 0
+getInt(bl): 0
+getLong(16): 0
+getLong(bl): 0
+getObject(16) is ok
+getObject(bl) is ok 
+getShort(16): 0
+getShort(bl): 0
+getString(16): null
+getString(bl): null
+getTime(16): null
+getTime(bl): null
+getTimestamp(16): null
+getTimestamp(bl): null
+rs.next() on closed result set got exception 
+Result Set Closed Exception
+just auto commit
+  bug4810 1, 1
+  bug4810 1, 2
+  LOCK TABLE
+Locks are held
+  bug4810 1, 3
+  LOCK TABLE
+Locks are held
+  LOCK TABLE
+commit with auto commit
+  bug4810 1, 1
+  bug4810 1, 2
+commit
+  LOCK TABLE
+Result Set Closed Exception
+  LOCK TABLE
+  LOCK TABLE
+rollback with auto commit
+  bug4810 1, 1
+  bug4810 1, 2
+rollback
+  LOCK TABLE
+Result Set Closed Exception
+  LOCK TABLE
+  LOCK TABLE
+START testMutableValues
+CHECKING on getXXX()
+ROW 1
+ROW 2
+ROW 3
+OK EQUALITY OBJECT RETURNED column 4 existing 1
+OK EQUALITY OBJECT RETURNED column 5 existing 1
+OK EQUALITY OBJECT RETURNED column 6 existing 1
+CHECKING on getObject()
+ROW 1
+ROW 2
+ROW 3
+OK EQUALITY OBJECT RETURNED column 4 existing 1
+OK EQUALITY OBJECT RETURNED column 5 existing 1
+OK EQUALITY OBJECT RETURNED column 6 existing 1
+COMPLETE testMutableValues
+Test resultset finished

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/savepointJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -40,18 +40,16 @@
 Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN CURSORS' clause are present.
 Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN LOCKS' clause are present.
 Expected Exception is Multiple or conflicting keywords involving the 'UNIQUE' clause are present.
-Test 17 No nested savepoints allowed when using SQL to set savepoints. This is to match DB2 LUW behavior
+Test 17 No nested savepoints allowed when using SQL to set savepoints.
 Test 17a Test with UNIQUE clause.
 Expected Exception is The maximum number of savepoints has been reached. 
 Test 17b Test without UNIQUE clause.
 Since no nesting is allowed, skipping UNIQUE still gives error for trying to define another savepoint
 Expected Exception is The maximum number of savepoints has been reached. 
 Test 18 No nested SQL savepoints allowed inside JDBC savepoint.
-This is to match DB2 LUW behavior
 Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
 Expected Exception is The maximum number of savepoints has been reached. 
 Test 19 No nested SQL savepoints allowed inside SQL savepoint.
-This is to match DB2 LUW behavior
 Following SQL savepoint will fail because we are trying to nest it inside SQL savepoint
 Expected Exception is The maximum number of savepoints has been reached. 
 Test 20 Rollback of SQL savepoint works same as rollback of JDBC savepoint.

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,649 @@
+ij> -- create some tables
+create table t1(c50 char(50), i int);
+0 rows inserted/updated/deleted
+ij> create table t2(c50 char(50), i int);
+0 rows inserted/updated/deleted
+ij> -- populate tables
+insert into t1 values ('b', 2), ('c', 3), ('d', 4), ('e', 5),
+		      ('f', 6), ('g', 7), ('h', 8), ('i', 9),
+		      ('j', 10), ('k', 11), ('l', 12), ('m', 13);
+12 rows inserted/updated/deleted
+ij> autocommit off;
+ij> -- negative
+----- position on forward only cursor
+get cursor c1 as 'select i from t1';
+ij> getcurrentrownumber c1;
+IJ ERROR: GETCURRENTROWNUMBER is not allowed on a forward only cursor.
+ij> first c1;
+IJ ERROR: FIRST is not allowed on a forward only cursor.
+ij> last c1;
+IJ ERROR: LAST is not allowed on a forward only cursor.
+ij> previous c1;
+IJ ERROR: PREVIOUS is not allowed on a forward only cursor.
+ij> next c1;
+I          
+-----
+2          
+ij> before first c1;
+IJ ERROR: BEFORE FIRST is not allowed on a forward only cursor.
+ij> after last c1;
+IJ ERROR: AFTER LAST is not allowed on a forward only cursor.
+ij> absolute 1 c1;
+IJ ERROR: ABSOLUTE is not allowed on a forward only cursor.
+ij> relative 1 c1;
+IJ ERROR: RELATIVE is not allowed on a forward only cursor.
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- 0 is invalid value for absolute
+absolute 0 c1;
+IJ ERROR: 0 is an invalid value for ABSOLUTE <integer> <cursorname>
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- relative is invalid when not positioned on a row
+relative 0 c1;
+ERROR (no SQLState): Cursor is Not on a Valid Row
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- relative is invalid when not positioned on a row
+relative 2 c1;
+ERROR (no SQLState): Cursor is Not on a Valid Row
+ij> close c1;
+ij> -- positive
+----- test positioning
+get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- 2
+first c1;
+C50 |I          
+-----
+b |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 3
+next c1;
+C50 |I          
+-----
+c |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- 2
+first c1;
+C50 |I          
+-----
+b |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 3
+next c1;
+C50 |I          
+-----
+c |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- 4
+next c1;
+C50 |I          
+-----
+d |4          
+ij> getcurrentrownumber c1;
+3
+ij> -- 2
+first c1;
+C50 |I          
+-----
+b |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 3
+next c1;
+C50 |I          
+-----
+c |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- null
+after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- beetle 5509
+----- null
+next c1;
+No current row
+ij> -- beetle 5509
+getcurrentrownumber c1;
+0
+ij> -- beetle 5509
+----- 13
+previous c1;
+C50 |I          
+-----
+m |13         
+ij> -- beetle 5509
+getcurrentrownumber c1;
+12
+ij> -- beetle 5509
+----- 12
+previous c1;
+C50 |I          
+-----
+l |12         
+ij> -- beetle 5509
+getcurrentrownumber c1;
+11
+ij> -- 13
+last c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- null
+before first c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 2
+next c1;
+C50 |I          
+-----
+b |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 13
+absolute 12 c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- 3
+absolute -11 c1;
+C50 |I          
+-----
+c |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- null
+absolute 13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- null
+absolute -13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- absolute -1 should be last row
+absolute -1 c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+12
+ij> close c1;
+ij> -- do last first
+get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- 13
+last c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- null
+next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+last c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- 12
+previous c1;
+C50 |I          
+-----
+l |12         
+ij> getcurrentrownumber c1;
+11
+ij> -- 2
+first c1;
+C50 |I          
+-----
+b |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- null
+previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 2
+next c1;
+C50 |I          
+-----
+b |2          
+ij> getcurrentrownumber c1;
+1
+ij> close c1;
+ij> -- do after last first
+get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- null
+after last c1;
+No current row
+ij> -- 13
+previous c1;
+C50 |I          
+-----
+m |13         
+ij> -- 12
+previous c1;
+C50 |I          
+-----
+l |12         
+ij> close c1;
+ij> -- go to next to last row, then do next
+get scroll insensitive cursor c1 as 'select * from t1 where i >= 11';
+ij> -- 11
+next c1;
+C50 |I          
+-----
+k |11         
+ij> getcurrentrownumber c1;
+1
+ij> -- 12
+next c1;
+C50 |I          
+-----
+l |12         
+ij> getcurrentrownumber c1;
+2
+ij> -- 13
+last c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+3
+ij> -- 12
+previous c1;
+C50 |I          
+-----
+l |12         
+ij> getcurrentrownumber c1;
+2
+ij> -- null
+after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+previous c1;
+C50 |I          
+-----
+m |13         
+ij> close c1;
+ij> -- start at after last
+get scroll insensitive cursor c1 as 'select * from t1 where i >= 11';
+ij> -- null
+after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+previous c1;
+C50 |I          
+-----
+m |13         
+ij> getcurrentrownumber c1;
+3
+ij> close c1;
+ij> -- use absolute to get rows before
+----- scan would get to them
+get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- 6
+absolute 5 c1;
+I          
+-----
+6          
+ij> getcurrentrownumber c1;
+5
+ij> -- 9
+absolute -5 c1;
+I          
+-----
+9          
+ij> getcurrentrownumber c1;
+8
+ij> -- 6
+absolute 5 c1;
+I          
+-----
+6          
+ij> getcurrentrownumber c1;
+5
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- null
+absolute 13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+previous c1;
+I          
+-----
+13         
+ij> getcurrentrownumber c1;
+12
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- null
+absolute -13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 2
+next c1;
+I          
+-----
+2          
+ij> getcurrentrownumber c1;
+1
+ij> close c1;
+ij> -- test relative implementation
+get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- 2
+first c1;
+I          
+-----
+2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 13
+relative 11 c1;
+I          
+-----
+13         
+ij> getcurrentrownumber c1;
+12
+ij> -- null
+relative 1 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+last c1;
+I          
+-----
+13         
+ij> getcurrentrownumber c1;
+12
+ij> -- 2
+relative -11 c1;
+I          
+-----
+2          
+ij> getcurrentrownumber c1;
+1
+ij> close c1;
+ij> -- scroll sensitive cursor becomes scroll insensitive
+commit;
+ij> get scroll sensitive cursor c1 as 'select i from t1';
+ij> first c1;
+I          
+-----
+2          
+ij> next c1;
+I          
+-----
+3          
+ij> update t1 set i = 666 where i = 2;
+1 row inserted/updated/deleted
+ij> first c1;
+I          
+-----
+2          
+ij> rollback;
+ij> -- verify that statement cache works
+----- correctly with scroll and forward only
+----- cursors on same query text
+get scroll insensitive cursor c1 as 'select i from t1';
+ij> get cursor c2 as 'select i from t1';
+ij> first c1;
+I          
+-----
+2          
+ij> next c2;
+I          
+-----
+2          
+ij> first c2;
+IJ ERROR: FIRST is not allowed on a forward only cursor.
+ij> close c1;
+ij> close c2;
+ij> -- first, last, etc. on empty result set
+get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> first c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> absolute 1 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> absolute -1 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> before first c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> absolute 1 c1;
+No current row
+ij> absolute -1 c1;
+No current row
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> absolute -1 c1;
+No current row
+ij> absolute 1 c1;
+No current row
+ij> close c1;
+ij> autocommit on;
+ij> get scroll insensitive with hold cursor c1 as 'select i from t1 where 1=0';
+ij> first c1;
+No current row
+ij> first c1;
+No current row
+ij> last c1;
+No current row
+ij> last c1;
+No current row
+ij> absolute 1 c1;
+No current row
+ij> absolute -1 c1;
+No current row
+ij> before first c1;
+No current row
+ij> after last c1;
+No current row
+ij> previous c1;
+No current row
+ij> next c1;
+No current row
+ij> -- beetle 5510
+next c1;
+No current row
+ij> close c1;
+ij> -- cursor on a sort
+get scroll insensitive cursor c1 as 'select * from t1 order by i desc';
+ij> -- 2
+last c1;
+C50 |I          
+-----
+b |2          
+ij> -- 13
+first c1;
+C50 |I          
+-----
+m |13         
+ij> -- 2
+relative 11 c1;
+C50 |I          
+-----
+b |2          
+ij> -- 3
+previous c1;
+C50 |I          
+-----
+c |3          
+ij> close c1;
+ij> -- RTS
+call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+Statement executed.
+ij> maximumdisplaywidth 2000;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> last c1;
+C50 |I          
+-----
+m |13         
+ij> first c1;
+C50 |I          
+-----
+b |2          
+ij> next c1;
+C50 |I          
+-----
+c |3          
+ij> close c1;
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+-----
+Statement Name: 
+	SQL_CURSH200C3
+Statement Text: 
+	select * from t1
+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: 
+Scroll Insensitive ResultSet:
+Number of opens = 1
+Rows seen = 11
+Number of reads from hash table = 15
+Number of writes to hash table = 12
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+Source result set:
+	Table Scan ResultSet for T1 at read committed isolation level using instantaneous share row locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 12
+	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=2
+		Number of pages visited=1
+		Number of rows qualified=12
+		Number of rows visited=12
+		Scan type=heap
+		start position: 
+null		stop position: 
+null		qualifiers:
+None
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> close c1;
+ij> -- for following set of tests, setting the holdability over commit to false for this connection since that is what we want to test below
+----- Using this rather than passing with nohold to cursor statement because this test also runs in jdk13 and lower and there is no way to
+----- set the holdability using jdbc api in those jdks (unless trying that through a jdbc program where one can use reflection to set holdability
+----- in jdk131)
+NoholdForConnection;
+ij> -- beetle 4551 - insensitive cursor uses estimated row count which might be
+----- pessimistic and will get out of memory error
+create table big(a int generated always as identity (start with 1, increment by 1));
+0 rows inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> get scroll insensitive cursor s1 as
+'select * from big b1 left outer join  big b2 on b1.a = b2.a left outer join  big b3 on b2.a = b3.a left outer join big b4 on b3.a = b4.a left outer join (big b5 left outer join (big b6 left outer join (big b7 left outer join big b8 on b7.a = b8.a) on b6.a=b7.a) on b5.a = b6.a) on b4.a = b5.a';
+ij> -- clean up
+drop table t1;
+0 rows inserted/updated/deleted
+ij> drop table t2;
+0 rows inserted/updated/deleted
+ij> drop table big;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,205 @@
+ij> --
+----- Specifically test SECURE users and various authentication
+----- service/scheme configuration for different databases.
+-----
+----- Configure the 6 different databases with for each
+----- of them, a different authentication scheme.
+-----
+----- 'wombat'				- default DERBY scheme &
+-----						  users known at system level.
+-----						  Some authorization restriction.
+----- 'guestSchemeDB'		- No authentication
+----- 'derbySchemeDB'	- BUILTIN authentication
+-----						  & some db authorization restriction.
+----- 'simpleSchemeDB'		- BUILTIN authentication and
+-----						  some db authorization restriction.
+-----                        (was the old Cloudscape 1.5 simple scheme)
+-----
+----- let's create all the dbs and configure them.
+----- we will authenticate using a default system user that we
+----- have configured.
+----- A typical bad guy who cannot access any database but guest
+----- is Jamie.
+-----
+-----
+----- 'guestSchemeDB' database authentication/authorization config
+-----
+connect 'guestSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION1)> -- override requireAuthentication to be turned OFF at the database level
+autocommit off;
+ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p1 using 'values(''derby.connection.requireAuthentication'', ''false'')';
+Statement executed.
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> --
+----- 'derbySchemeDB' database authentication/authorization config
+-----
+connect 'derbySchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION2)> autocommit off;
+ij(CONNECTION2)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION2)> execute p2 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+Statement executed.
+ij(CONNECTION2)> -- let's define users in this database (other than the ones
+----- known at the system level. This is for the test
+----- These 3 users will only be known in this database
+execute p2 using 'values(''derby.user.martin'', ''obfuscateIt'')';
+Statement executed.
+ij(CONNECTION2)> execute p2 using 'values(''derby.user.dan'', ''makeItFaster'')';
+Statement executed.
+ij(CONNECTION2)> execute p2 using 'values(''derby.user.mamta'', ''ieScape'')';
+Statement executed.
+ij(CONNECTION2)> execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+Statement executed.
+ij(CONNECTION2)> commit;
+ij(CONNECTION2)> autocommit on;
+ij(CONNECTION2)> --
+----- 'simpleSchemeDB' database authentication/authorization config
+-----
+connect 'simpleSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION3)> autocommit off;
+ij(CONNECTION3)> prepare p5 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION3)> execute p5 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+Statement executed.
+ij(CONNECTION3)> --
+-----  only allow these 3 users
+execute p5 using 'values(''derby.database.fullAccessUsers'', ''system,jeff,howardR'')';
+Statement executed.
+ij(CONNECTION3)> execute p5 using 'values(''derby.database.readOnlyAccessUsers'', ''francois'')';
+Statement executed.
+ij(CONNECTION3)> -- no access to Jamie only as he's a well known hooligan
+execute p5 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+Statement executed.
+ij(CONNECTION3)> commit;
+ij(CONNECTION3)> autocommit on;
+ij(CONNECTION3)> --
+----- Shutdown the system for database properties to take effect
+-----
+disconnect all;
+ij> connect 'wombat;user=system;password=manager;shutdown=true';
+ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ij> connect 'guestSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: guestSchemeDB08006.DDatabase 'guestSchemeDB' shutdown.((server log XXX)
+ij> connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'simpleSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: simpleSchemeDB08006.DDatabase 'simpleSchemeDB' shutdown.((server log XXX)
+ij> disconnect all;
+ij> -- shuting down the system causes IJ to loose the protocol, therefore
+----- we'd be doomed :(
+#connect ';shutdown=true;user=system;password=manager';
+IJ ERROR: Unable to establish connection
+ij> -- 1) Valid authentication & authorization requests/ops
+----- 
+connect 'wombat;create=true;user=kreg;password=IwasBornReady';
+ij> connect 'wombat;user=jeff;password=homeRun';
+ij(CONNECTION1)> connect 'wombat;user=howardR;password=takeItEasy';
+ij(CONNECTION2)> connect 'wombat;user=francois;password=paceesalute';
+ij(CONNECTION3)> -- Invalid ones:
+connect 'wombat;user=Jamie;password=theHooligan';
+ij(CONNECTION4)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;create=true;user=kreg;password=IwasBornReady
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=jeff;password=homeRun
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/wombat;user=howardR;password=takeItEasy
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION4* - 	jdbc:derby:net://localhost:1527/wombat;user=Jamie;password=theHooligan
+* = current connection
+ij(CONNECTION4)> connect 'guestSchemeDB;user=kreg;password=IwasBornReady';
+ij(CONNECTION5)> connect 'guestSchemeDB;user=jeff;password=homeRun';
+ij(CONNECTION6)> connect 'guestSchemeDB;user=howardR;password=takeItEasy';
+ij(CONNECTION7)> connect 'guestSchemeDB;user=francois;password=paceesalute';
+ij(CONNECTION8)> -- Invalid ones:
+connect 'guestSchemeDB;user=Jamie;password=theHooligan';
+ij(CONNECTION9)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;create=true;user=kreg;password=IwasBornReady
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=jeff;password=homeRun
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/wombat;user=howardR;password=takeItEasy
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION4 - 	jdbc:derby:net://localhost:1527/wombat;user=Jamie;password=theHooligan
+CONNECTION5 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=kreg;password=IwasBornReady
+CONNECTION6 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=jeff;password=homeRun
+CONNECTION7 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=howardR;password=takeItEasy
+CONNECTION8 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=francois;password=paceesalute
+CONNECTION9* - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=Jamie;password=theHooligan
+* = current connection
+ij(CONNECTION9)> connect 'derbySchemeDB;user=mamta;password=ieScape';
+ij(CONNECTION10)> connect 'derbySchemeDB;user=dan;password=makeItFaster';
+ij(CONNECTION11)> connect 'derbySchemeDB;user=martin;password=obfuscateIt';
+ij(CONNECTION12)> -- Invalid ones:
+connect 'derbySchemeDB;user=Jamie;password=theHooligan';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION12)> connect 'derbySchemeDB;user=francois;password=paceesalute';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION12)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;create=true;user=kreg;password=IwasBornReady
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=jeff;password=homeRun
+CONNECTION10 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION11 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION12* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/wombat;user=howardR;password=takeItEasy
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION4 - 	jdbc:derby:net://localhost:1527/wombat;user=Jamie;password=theHooligan
+CONNECTION5 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=kreg;password=IwasBornReady
+CONNECTION6 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=jeff;password=homeRun
+CONNECTION7 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=howardR;password=takeItEasy
+CONNECTION8 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=francois;password=paceesalute
+CONNECTION9 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=Jamie;password=theHooligan
+* = current connection
+ij(CONNECTION12)> connect 'simpleSchemeDB;user=jeff;password=homeRun';
+ij(CONNECTION13)> connect 'simpleSchemeDB;user=howardR;password=takeItEasy';
+ij(CONNECTION14)> connect 'simpleSchemeDB;user=francois;password=paceesalute';
+ij(CONNECTION15)> -- Read-only user
+create table t1 (c1 int);
+ERROR 25503: DDL is not permitted for a read-only connection, user or database.
+ij(CONNECTION15)> -- Invalid ones:
+connect 'simpleSchemeDB;user=Jamie;password=theHooligan';
+ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ij(CONNECTION15)> connect 'simpleSchemeDB;user=dan;password=makeItFaster';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION15)> connect 'simpleSchemeDB;user=francois;password=corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION15)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;create=true;user=kreg;password=IwasBornReady
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=jeff;password=homeRun
+CONNECTION10 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION11 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION12 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+CONNECTION13 - 	jdbc:derby:net://localhost:1527/simpleSchemeDB;user=jeff;password=homeRun
+CONNECTION14 - 	jdbc:derby:net://localhost:1527/simpleSchemeDB;user=howardR;password=takeItEasy
+CONNECTION15* - 	jdbc:derby:net://localhost:1527/simpleSchemeDB;user=francois;password=paceesalute
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/wombat;user=howardR;password=takeItEasy
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION4 - 	jdbc:derby:net://localhost:1527/wombat;user=Jamie;password=theHooligan
+CONNECTION5 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=kreg;password=IwasBornReady
+CONNECTION6 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=jeff;password=homeRun
+CONNECTION7 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=howardR;password=takeItEasy
+CONNECTION8 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=francois;password=paceesalute
+CONNECTION9 - 	jdbc:derby:net://localhost:1527/guestSchemeDB;user=Jamie;password=theHooligan
+* = current connection
+ij(CONNECTION15)> disconnect all;
+ij> show connections;
+No connections available.
+ij> -- Database shutdown - check user - should fail
+connect 'derbySchemeDB;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> show connections;
+No connections available.
+ij> -- Database shutdown - check user - should succeed
+connect 'wombat;user=jeff;password=homeRun;shutdown=true';
+ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ij> connect 'guestSchemeDB;user=kreg;password=IwasBornReady;shutdown=true';
+ERROR 08006: guestSchemeDB08006.DDatabase 'guestSchemeDB' shutdown.((server log XXX)
+ij> connect 'derbySchemeDB;user=mamta;password=ieScape;shutdown=true';
+ERROR 08006: derbySchemeDB08006.DDatabase 'derbySchemeDB' shutdown.((server log XXX)
+ij> connect 'simpleSchemeDB;user=jeff;password=homeRun;shutdown=true';
+ERROR 08006: simpleSchemeDB08006.DDatabase 'simpleSchemeDB' shutdown.((server log XXX)
+ij> show connections;
+No connections available.
+ij> -- Derby system shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> disconnect all;
+ij> -- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers1.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsers1.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,41 @@
+ij> --
+----- Negative test for SECURE users. This tries to authenticate against an LDAP
+----- server on a machine which is not accessible/doesn't exist.
+-----
+----- 'ldapSchemeDB'		- LDAP authentication (on NT thru LDAP)
+----- let's create the db and configure it.
+----- we will authenticate using a default system user that we have configured.
+-----
+----- 'ldapSchemeDB' database authentication/authorization config
+-----
+connect 'ldapSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p1 using 'values(''derby.authentication.provider'', ''LDAP'')';
+Statement executed.
+ij(CONNECTION1)> -- there is no such machine as noSuchMachine and so the authentication will fail
+execute p1 using 'values(''derby.authentication.server'', ''noSuchMachine:389'')';
+Statement executed.
+ij(CONNECTION1)> execute p1 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+Statement executed.
+ij(CONNECTION1)> -- this is the default search filter
+execute p1 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+Statement executed.
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> --
+----- Shutdown the system for database properties to take effect
+-----
+disconnect all;
+ij> connect 'ldapSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: ldapSchemeDB08006.DDatabase 'ldapSchemeDB' shutdown.((server log XXX)
+ij> disconnect all;
+ij> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> show connections;
+No connections available.
+ij> disconnect all;
+ij> -- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsersldap.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsersldap.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/secureUsersldap.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,223 @@
+ij> --
+----- Specifically test SECURE users with ldap 
+----- Configure the ldap databases, plus some for reference
+-----
+----- 'derbySchemeDB'	- BUILTIN authentication
+-----						  & some db authorization restriction.
+----- 'ldapSchemeDB'		- LDAP authentication
+-----						  (or NT thru LDAP)
+----- 'ldapSchemeDBJN'	- LDAP setting url through java.naming.*
+-----						  some db authorization restriction.
+-----
+----- let's create all the dbs and configure them.
+----- we will authenticate using a default system user that we
+----- have configured.
+----- A typical bad guy who cannot access any database but guest
+----- is Jamie.
+-----
+-----
+----- 'derbySchemeDB' database authentication/authorization config
+-----
+connect 'derbySchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p2 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+Statement executed.
+ij(CONNECTION1)> -- let's define users in this database (other than the ones
+----- known at the system level. This is for the test
+----- These 3 users will only be known in this database
+execute p2 using 'values(''derby.user.martin'', ''obfuscateIt'')';
+Statement executed.
+ij(CONNECTION1)> execute p2 using 'values(''derby.user.dan'', ''makeItFaster'')';
+Statement executed.
+ij(CONNECTION1)> execute p2 using 'values(''derby.user.mamta'', ''ieScape'')';
+Statement executed.
+ij(CONNECTION1)> execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+Statement executed.
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> --
+----- 'ldapSchemeDB' database authentication/authorization config
+-----
+connect 'ldapSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION2)> autocommit off;
+ij(CONNECTION2)> prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION2)> execute p3 using 'values(''derby.authentication.provider'', ''LDAP'')';
+Statement executed.
+ij(CONNECTION2)> execute p3 using 'values(''derby.authentication.server'', ''thehost.opensource.apache.com:389'')';
+Statement executed.
+ij(CONNECTION2)> execute p3 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+Statement executed.
+ij(CONNECTION2)> -- this is the default search filter
+execute p3 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+Statement executed.
+ij(CONNECTION2)> commit;
+ij(CONNECTION2)> autocommit on;
+ij(CONNECTION2)> connect 'ldapSchemeDBJN;create=true;user=system;password=manager';
+ij(CONNECTION3)> autocommit off;
+ij(CONNECTION3)> prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION3)> execute p3 using 'values(''derby.authentication.provider'', ''LDAP'')';
+Statement executed.
+ij(CONNECTION3)> execute p3 using 'values(''java.naming.provider.url'', ''ldap://thehost.opensource.apache.com:389'')';
+Statement executed.
+ij(CONNECTION3)> execute p3 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+Statement executed.
+ij(CONNECTION3)> -- this is the default search filter
+execute p3 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+Statement executed.
+ij(CONNECTION3)> commit;
+ij(CONNECTION3)> autocommit on;
+ij(CONNECTION3)> disconnect;
+ij> --
+----- Shutdown the system for database properties to take effect
+-----
+disconnect all;
+ij> connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'ldapSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: ldapSchemeDB08006.DDatabase 'ldapSchemeDB' shutdown.((server log XXX)
+ij> connect 'ldapSchemeDBJN;user=system;password=manager;shutdown=true';
+ERROR 08006: ldapSchemeDBJN08006.DDatabase 'ldapSchemeDBJN' shutdown.((server log XXX)
+ij> disconnect all;
+ij> -- shuting down the system causes IJ to loose the protocol, therefore
+----- we'd be doomed :(
+#connect ';shutdown=true;user=system;password=manager';
+IJ ERROR: Unable to establish connection
+ij> -- 1) Valid authentication & authorization requests/ops
+connect 'derbySchemeDB;user=mamta;password=ieScape';
+ij> connect 'derbySchemeDB;user=dan;password=makeItFaster';
+ij(CONNECTION1)> connect 'derbySchemeDB;user=martin;password=obfuscateIt';
+ij(CONNECTION2)> -- Invalid ones:
+connect 'derbySchemeDB;user=Jamie;password=theHooligan';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'derbySchemeDB;user=francois;password=paceesalute';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> --
+----- 1rst test phase for LDAP
+----- We look-up the user DN and authenticate to LDAP with passed-in
+----- credentials
+connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=francois;password=corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> -- Invalid ones:
+connect 'ldapSchemeDB;user=Jamie;password=theHooligan';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=dan;password=makeItFaster';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> -- wrong ldap password
+connect 'ldapSchemeDB;user=francois;password=paceesalute';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> --
+----- 2nd test phases for LDAP - Cache the User DN locally
+----- to avoid the initial look-up
+-----
+connect 'ldapSchemeDB;user=francois;password=corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> autocommit off;
+ij(CONNECTION2)> prepare p5 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION2)> execute p5 using 'values(''derby.authentication.ldap.searchFilter'', ''derby.user'')';
+Statement executed.
+ij(CONNECTION2)> -- set the users DN locally now
+execute p5 using 'values(''derby.user.mamta'', ''uid=mamta,ou=People,o=opensource.apache.com'')';
+Statement executed.
+ij(CONNECTION2)> execute p5 using 'values(''derby.user.francois'', ''uid=francois,ou=People,o=opensource.apache.com'')';
+Statement executed.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> commit;
+ij(CONNECTION2)> autocommit on;
+ij(CONNECTION2)> -- restart ldapSchemeDB for properties to take effect & reconnect to test
+connect 'ldapSchemeDB;user=francois;password=corsica;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> -- re-test
+connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=francois;password=corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> -- 2a) Some users with no local DN: rachael, kathy
+-----     as no local DN cached, look-up will be performed with
+-----     default search filter.
+-----
+connect 'ldapSchemeDB;user=kathy;password=kathyS';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=rachael;password=rachaelF';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> -- Invalid ones:
+connect 'ldapSchemeDB;user=Jamie;password=theHooligan';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=dan;password=makeItFaster';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> -- wrong ldap password
+connect 'ldapSchemeDB;user=francois;password=paceesalute';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> -- Database shutdown - check user - should fail
+connect 'derbySchemeDB;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> -- Database shutdown - check user - should succeed
+connect 'derbySchemeDB;user=mamta;password=ieScape;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=mamta;password=ieScape
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=dan;password=makeItFaster
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/derbySchemeDB;user=martin;password=obfuscateIt
+* = current connection
+ij(CONNECTION2)> -- Derby system shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> disconnect all;
+ij> --
+----- 1rst test phase for LDAP
+----- We look-up the user DN and authenticate to LDAP with passed-in
+----- credentials
+connect 'ldapSchemeDBJN;user=mamta;password=yeeHaLdap';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'ldapSchemeDBJN;user=francois;password=corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> -- Invalid ones:
+connect 'ldapSchemeDBJN;user=Jamie;password=theHooligan';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'ldapSchemeDBJN;user=dan;password=makeItFaster';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> -- wrong ldap password
+connect 'ldapSchemeDBJN;user=francois;password=paceesalute';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> show connections;
+No connections available.
+ij> disconnect all;
+ij> -- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,153 @@
+ij> --
+connect 'wombat;create=true;user=dan;password=MakeItFaster';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p1 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+Statement executed.
+ij(CONNECTION1)> execute p1 using 'values(''derby.database.fullAccessUsers'', ''francois,jeff,howardR,ames,kreg'')';
+Statement executed.
+ij(CONNECTION1)> remove p1;
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> disconnect;
+ij> connect 'wombat;shutdown=true;user=francois;password=paceesalute';
+ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ij> connect 'myDB;create=true;user=dan;password=MakeItFaster';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p2 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+Statement executed.
+ij(CONNECTION1)> execute p2 using 'values(''derby.database.fullAccessUsers'', ''jerry,kreg,dan,jamie,ames,francois'')';
+Statement executed.
+ij(CONNECTION1)> remove p2;
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> disconnect;
+ij> connect 'myDB;shutdown=true;user=dan;password=MakeItFaster';
+ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ij> -- beetle 5468
+disconnect all;
+ij> -- Specifically test JBMS users.
+-----
+----- check allowed users in wombat db.
+connect 'wombat;user=kreg;password=visualWhat?';
+ij> connect 'wombat;user=jeff;password=HomeRun61';
+ij(CONNECTION1)> connect 'wombat;user=ames;password=AnyVolunteer?';
+ij(CONNECTION2)> connect 'wombat;user=howardR;password=IamBetterAtTennis';
+ij(CONNECTION3)> connect 'wombat;user=francois;password=paceesalute';
+ij(CONNECTION4)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;user=kreg;password=visualWhat?
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=jeff;password=HomeRun61
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/wombat;user=ames;password=AnyVolunteer?
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/wombat;user=howardR;password=IamBetterAtTennis
+CONNECTION4* - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+* = current connection
+ij(CONNECTION4)> disconnect all;
+ij> -- check allowed users in myDB db.
+----- also check USER flavors
+connect 'myDB;user=jerry;password=SacreBleu';
+ij> create table APP.t1(c1 char(30) check (UPPER(c1) <> 'JAMIE'));
+0 rows inserted/updated/deleted
+ij> insert into APP.t1 values CURRENT_USER;
+1 row inserted/updated/deleted
+ij> connect 'myDB;user=kreg;password=visualWhat?';
+ij(CONNECTION1)> insert into APP.t1 values USER;
+1 row inserted/updated/deleted
+ij(CONNECTION1)> connect 'myDB;user=ames;password=AnyVolunteer?';
+ij(CONNECTION2)> insert into APP.t1 values SESSION_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION2)> connect 'myDB;user=dan;password=MakeItFaster';
+ij(CONNECTION3)> select * from APP.t1;
+C1                            
+-----
+JERRY                         
+KREG                          
+AMES                          
+ij(CONNECTION3)> update APP.t1 set c1 = {fn user() };
+3 rows inserted/updated/deleted
+ij(CONNECTION3)> select * from APP.t1;
+C1                            
+-----
+DAN                           
+DAN                           
+DAN                           
+ij(CONNECTION3)> connect 'myDB;user=francois;password=paceesalute';
+ij(CONNECTION4)> update APP.t1 set c1 = USER;
+3 rows inserted/updated/deleted
+ij(CONNECTION4)> connect 'myDB;user=jamie;password=MrNamePlates';
+ij(CONNECTION5)> select * from APP.t1;
+C1                            
+-----
+FRANCOIS                      
+FRANCOIS                      
+FRANCOIS                      
+ij(CONNECTION5)> update APP.t1 set c1 = USER;
+ERROR 23513: The check constraint 'xxxxGENERATED-IDxxxx' was violated while performing an INSERT or UPDATE on table 'APP.T1'.
+ij(CONNECTION5)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/myDB;user=jerry;password=SacreBleu
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/myDB;user=kreg;password=visualWhat?
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/myDB;user=ames;password=AnyVolunteer?
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/myDB;user=dan;password=MakeItFaster
+CONNECTION4 - 	jdbc:derby:net://localhost:1527/myDB;user=francois;password=paceesalute
+CONNECTION5* - 	jdbc:derby:net://localhost:1527/myDB;user=jamie;password=MrNamePlates
+* = current connection
+ij(CONNECTION5)> disconnect all;
+ij> --
+----- some negative cases
+-----
+----- Invalid login's
+connect 'wombat';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=badUser1;password=YeeHa!';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=badUser2;password=YeeHa!';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'myDB;user=dan;password=MakeItSlower';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'myDB;user=jamie;password=LetMeIn';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=francois;password=Corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> -- Invalid database users
+connect 'myDB;user=howardR;password=IamBetterAtTennis';
+ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ij> connect 'wombat;user=jerry;password=SacreBleu';
+ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ij> connect 'wombat;user=jamie;password=MrNamePlates';
+ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ij> show connections;
+No connections available.
+ij> connect 'wombat;user=francois;password=paceesalute';
+ij> connect 'myDB;user=jerry;password=SacreBleu';
+ij(CONNECTION1)> -- Database shutdown - check user - should fail
+connect 'myDB;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION1)> connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION1)> connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 04501: 04501.CDatabase connection refused.((server log XXX)
+ij(CONNECTION1)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION1* - 	jdbc:derby:net://localhost:1527/myDB;user=jerry;password=SacreBleu
+* = current connection
+ij(CONNECTION1)> -- Database shutdown - check user - should succeed
+----- beetle 5367
+connect 'wombat;user=francois;password=paceesalute;shutdown=true';
+ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ij(CONNECTION1)> connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ij(CONNECTION1)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION1* - 	jdbc:derby:net://localhost:1527/myDB;user=jerry;password=SacreBleu
+* = current connection
+ij(CONNECTION1)> -- JBMS System shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION1)> disconnect all;
+ij> -- JBMS System shutdown - check user - should succeed
+connect ';user=francois;password=paceesalute;shutdown=true';
+ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ij> -- beetle 5390
+----- the server does not shut down properly in network server
+;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users2.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users2.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/users2.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,241 @@
+ij> --
+----- Specifically test Derby users using DERBY scheme
+----- and by only looking at database properties for authentication
+----- The only user at the system level is system/manager
+-----
+----- check allowed users in wombat db.
+----- initial connection in sysprop was:
+----- connect 'wombat;create=true;user=system;password=manager';
+-----
+----- Default to: derby.authentication.provider=BUILTIN
+-----
+autocommit off;
+ij> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p1 using 'values(''derby.connection.requireAuthentication'', ''true'')';
+Statement executed.
+ij> commit;
+ij> remove p1;
+ij> autocommit on;
+ij> disconnect all;
+ij> connect 'wombat;shutdown=true;user=system;password=manager';
+ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ij> -- beetle 5468
+disconnect all;
+ij> connect 'wombat;user=system;password=manager';
+ij> --
+----- set authentication config for 'wombat' database
+-----
+autocommit off;
+ij> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p2 using 'values(''derby.user.kreg'', ''visualWhat?'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.user.jeff'', ''HomeRun61'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.user.ames'', ''AnyVolunteer?'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.user.jamie'', ''MrNamePlates'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.user.howardR'', ''IamBetterAtTennis'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.user.francois'', ''paceesalute'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.database.fullAccessUsers'', ''jeff,howardR,ames,francois,kreg'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.database.readOnlyAccessUsers'', ''jamie'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+Statement executed.
+ij> execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+Statement executed.
+ij> commit;
+ij> autocommit on;
+ij> -- Check that the passwords are encrypted
+----- values getDatabaseProperty('derby.user.francois');
+----- values getDatabaseProperty('derby.user.ames');
+----- values getDatabaseProperty('derby.user.kreg');
+----- values getDatabaseProperty('derby.user.jeff');
+----- values getDatabaseProperty('derby.user.howardR');
+----- values getDatabaseProperty('derby.user.jamie');
+connect 'wombat;user=kreg;password=visualWhat?';
+ij(CONNECTION1)> connect 'wombat;user=jeff;password=HomeRun61';
+ij(CONNECTION2)> connect 'wombat;user=ames;password=AnyVolunteer?';
+ij(CONNECTION3)> connect 'wombat;user=howardR;password=IamBetterAtTennis';
+ij(CONNECTION4)> -- should succeed
+create table APP.t1(c1 char(30));
+0 rows inserted/updated/deleted
+ij(CONNECTION4)> insert into APP.t1 values CURRENT_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION4)> connect 'wombat;user=jamie;password=MrNamePlates';
+ij(CONNECTION5)> -- should fail as readOnly user
+insert into APP.t1 values CURRENT_USER;
+ERROR 25502: An SQL data change is not permitted for a read-only connection, user or database.
+ij(CONNECTION5)> create table APP.t2(c1 char(30));
+ERROR 25503: DDL is not permitted for a read-only connection, user or database.
+ij(CONNECTION5)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;user=system;password=manager
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=kreg;password=visualWhat?
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/wombat;user=jeff;password=HomeRun61
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/wombat;user=ames;password=AnyVolunteer?
+CONNECTION4 - 	jdbc:derby:net://localhost:1527/wombat;user=howardR;password=IamBetterAtTennis
+CONNECTION5* - 	jdbc:derby:net://localhost:1527/wombat;user=jamie;password=MrNamePlates
+* = current connection
+ij(CONNECTION5)> disconnect all;
+ij> -- check allowed users in myDB db.
+-----
+connect 'myDB;create=true;user=system;password=manager';
+ij> autocommit off;
+ij> prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p3 using 'values(''derby.connection.requireAuthentication'', ''true'')';
+Statement executed.
+ij> remove p3;
+ij> autocommit on;
+ij> disconnect all;
+ij> connect 'myDB;shutdown=true;user=system;password=manager';
+ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ij> -- beetle 5468
+disconnect all;
+ij> connect 'myDB;user=system;password=manager';
+ij> --
+----- set authentication config for 'myDB' database
+-----
+autocommit off;
+ij> prepare p4 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p4 using 'values(''derby.user.kreg'', ''visualWhat?'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.user.dan'', ''MakeItFaster'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.user.ames'', ''AnyVolunteer?'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.user.jerry'', ''SacreBleu'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.user.jamie'', ''MrNamePlates'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.user.francois'', ''paceesalute'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.database.fullAccessUsers'', ''jerry,dan,kreg,ames,francois,jamie'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+Statement executed.
+ij> execute p4 using 'values(''derby.database.propertiesOnly'', ''true'')';
+Statement executed.
+ij> commit;
+ij> autocommit on;
+ij> -- Check that the passwords are encrypted
+----- values getDatabaseProperty('derby.user.francois');
+----- values getDatabaseProperty('derby.user.ames');
+----- values getDatabaseProperty('derby.user.kreg');
+----- values getDatabaseProperty('derby.user.dan');
+----- values getDatabaseProperty('derby.user.jerry');
+----- values getDatabaseProperty('derby.user.jamie');
+-----
+----- also check USER flavors
+-----
+connect 'myDB;user=jerry;password=SacreBleu';
+ij(CONNECTION1)> create table APP.t1(c1 char(30) check (UPPER(c1) <> 'JAMIE'));
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> insert into APP.t1 values CURRENT_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION1)> connect 'myDB;user=kreg;password=visualWhat?';
+ij(CONNECTION2)> insert into APP.t1 values USER;
+1 row inserted/updated/deleted
+ij(CONNECTION2)> connect 'myDB;user=ames;password=AnyVolunteer?';
+ij(CONNECTION3)> insert into APP.t1 values SESSION_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION3)> connect 'myDB;user=dan;password=MakeItFaster';
+ij(CONNECTION4)> select * from APP.t1;
+C1                            
+-----
+JERRY                         
+KREG                          
+AMES                          
+ij(CONNECTION4)> update APP.t1 set c1 = USER;
+3 rows inserted/updated/deleted
+ij(CONNECTION4)> select * from APP.t1;
+C1                            
+-----
+DAN                           
+DAN                           
+DAN                           
+ij(CONNECTION4)> connect 'myDB;user=francois;password=paceesalute';
+ij(CONNECTION5)> update APP.t1 set c1 = USER;
+3 rows inserted/updated/deleted
+ij(CONNECTION5)> connect 'myDB;user=jamie;password=MrNamePlates';
+ij(CONNECTION6)> select * from APP.t1;
+C1                            
+-----
+FRANCOIS                      
+FRANCOIS                      
+FRANCOIS                      
+ij(CONNECTION6)> update APP.t1 set c1 = USER;
+ERROR 23513: The check constraint 'xxxxGENERATED-IDxxxx' was violated while performing an INSERT or UPDATE on table 'APP.T1'.
+ij(CONNECTION6)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/myDB;user=system;password=manager
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/myDB;user=jerry;password=SacreBleu
+CONNECTION2 - 	jdbc:derby:net://localhost:1527/myDB;user=kreg;password=visualWhat?
+CONNECTION3 - 	jdbc:derby:net://localhost:1527/myDB;user=ames;password=AnyVolunteer?
+CONNECTION4 - 	jdbc:derby:net://localhost:1527/myDB;user=dan;password=MakeItFaster
+CONNECTION5 - 	jdbc:derby:net://localhost:1527/myDB;user=francois;password=paceesalute
+CONNECTION6* - 	jdbc:derby:net://localhost:1527/myDB;user=jamie;password=MrNamePlates
+* = current connection
+ij(CONNECTION6)> disconnect all;
+ij> --
+----- some negative cases
+-----
+----- Invalid login's
+connect 'wombat';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=badUser1;password=YeeHa!';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=badUser2;password=YeeHa!';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'myDB;user=dan;password=MakeItSlower';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'myDB;user=jamie;password=LetMeIn';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=francois;password=Corsica';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> -- Invalid database users
+connect 'myDB;user=howardR;password=IamBetterAtTennis';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=jerry;password=SacreBleu';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> connect 'wombat;user=jamie;password=MrNamePlates';
+ij> show connections;
+CONNECTION0* - 	jdbc:derby:net://localhost:1527/wombat;user=jamie;password=MrNamePlates
+* = current connection
+ij> connect 'wombat;user=francois;password=paceesalute';
+ij(CONNECTION1)> connect 'myDB;user=jerry;password=SacreBleu';
+ij(CONNECTION2)> -- Database shutdown - check user - should fail
+connect 'myDB;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:net://localhost:1527/wombat;user=jamie;password=MrNamePlates
+CONNECTION1 - 	jdbc:derby:net://localhost:1527/wombat;user=francois;password=paceesalute
+CONNECTION2* - 	jdbc:derby:net://localhost:1527/myDB;user=jerry;password=SacreBleu
+* = current connection
+ij(CONNECTION2)> disconnect all;
+ij> show connections;
+No connections available.
+ij> -- Database shutdown - check user - should succeed
+connect 'wombat;user=francois;password=paceesalute;shutdown=true';
+ERROR 08006: wombat08006.DDatabase 'wombat' shutdown.((server log XXX)
+ij> -- beetle 5468
+disconnect all;
+ij> connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 08006: myDB08006.DDatabase 'myDB' shutdown.((server log XXX)
+ij> -- beetle 5468
+disconnect all;
+ij> -- there should be no connections left here
+show connections;
+No connections available.
+ij> -- JBMS System shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR (no SQLState): Connection authorization failure occurred.  Reason: userid invalid.
+ij> -- JBMS System shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: XJ015.MDerby system shutdown.((server log XXX)
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/EscalateLock.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/EscalateLock.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/EscalateLock.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1042 @@
+ij> -- test lock escalation.  derby.locks.escalationThreshold=100 property 
+-- has been set to force lock escalation
+-- to occur at the minimum level of 100  locks.
+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> -- TEST 1 - make sure IX row locks are escalated to a persistent X table lock.
+create table foo (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- first insert 90 rows
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> -- check to make sure we have IX table and X row locks.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |9   |IX  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,14)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,15)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,16)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,17)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,18)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,19)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,20)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,21)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,22)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,23)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,24)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,25)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,26)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,27)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,28)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,29)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,30)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,31)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,32)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,33)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,34)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,35)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,36)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,37)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,38)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,39)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,40)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,41)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,42)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,43)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,44)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,45)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,46)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,47)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,48)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,49)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,50)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,51)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,52)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,53)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,54)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,55)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,56)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,57)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,58)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,59)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,60)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,61)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,62)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,63)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,64)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,65)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,66)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,67)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,68)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,69)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,70)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,71)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,72)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,73)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,74)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,75)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,76)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,77)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,78)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,79)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,80)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,81)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,82)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,83)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,84)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,85)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,86)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,87)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,88)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,89)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,90)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,91)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,92)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,93)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,94)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,95)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,96)    |GRANT|ACTIVE  
+ij> -- now insert 10 more rows, pushing the lock over the escalation limit.
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> -- check to make sure we now just have a X table lock.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |11  |IX  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |FOO         |Tablelock |GRANT|ACTIVE  
+ij> -- insert 10 more rows to make sure we don't get rows locks from now on.
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+10 rows inserted/updated/deleted
+ij> -- check to make sure we now just have a X table lock.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |12  |IX  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |FOO         |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> -- TEST 2 - make sure IS row locks are escalated to a persistent X table lock.
+create index foox on foo (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> set isolation serializable;
+0 rows inserted/updated/deleted
+ij> -- get IS row locks on just under 100 of the rows;
+select a from foo where a < 5;
+A          
+-----------
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+1          
+1          
+1          
+1          
+1          
+1          
+1          
+1          
+1          
+1          
+1          
+2          
+2          
+2          
+2          
+2          
+2          
+2          
+2          
+2          
+2          
+2          
+3          
+3          
+3          
+3          
+3          
+3          
+3          
+3          
+3          
+3          
+3          
+4          
+4          
+4          
+4          
+4          
+4          
+4          
+4          
+4          
+4          
+4          
+ij> -- check to make sure we have IS table and S row locks.
+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  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,100)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,101)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,107)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,108)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,109)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,110)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,111)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,17)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,18)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,19)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,20)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,21)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,27)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,28)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,29)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,30)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,31)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,37)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,38)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,39)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,40)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,41)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,47)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,48)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,49)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,50)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,51)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,57)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,58)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,59)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,60)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,61)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,67)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,68)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,69)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,70)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,71)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,77)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,78)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,79)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,80)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,81)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,87)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,88)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,89)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,90)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,91)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,97)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,98)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |FOO         |(1,99)    |GRANT|ACTIVE  
+ij> -- now get enough IS row locks to push over the lock escalation limit
+select a from foo where a >= 5;
+A          
+-----------
+5          
+5          
+5          
+5          
+5          
+5          
+5          
+5          
+5          
+5          
+5          
+6          
+6          
+6          
+6          
+6          
+6          
+6          
+6          
+6          
+6          
+6          
+7          
+7          
+7          
+7          
+7          
+7          
+7          
+7          
+7          
+7          
+7          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+9          
+9          
+9          
+9          
+9          
+9          
+9          
+9          
+9          
+9          
+9          
+ij> -- check to make sure we now just have a S table lock.
+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   |IS  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |S   |FOO         |Tablelock |GRANT|ACTIVE  
+ij> -- make sure subsequent IS locks are recognized as covered by the S table lock.
+select a from foo where a = 8;
+A          
+-----------
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+8          
+ij> -- check to make sure we now just have a S table lock.
+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   |IS  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |S   |FOO         |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> -- TEST 3 - reproduce abort failure similar to bug 4328
+create table aborttest (keycol int, data varchar(1000));
+0 rows inserted/updated/deleted
+ij> -- first insert 110 rows
+insert into aborttest values (0, PADSTRING('0',1000)), (0, PADSTRING('1',1000)), (0, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('3',1000)), (0, PADSTRING('4',1000)), (0, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('6',1000)), (0, PADSTRING('7',1000)), (0, PADSTRING('8',1000)), (0, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values  (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+3 rows inserted/updated/deleted
+ij> insert into aborttest values  (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+4 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> create index idx on aborttest (keycol, data);
+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 aborttest where keycol < 3;
+40 rows inserted/updated/deleted
+ij> -- check to make sure we have a X row locks and IX table lock;
+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  |ABORTTEST   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |ABORTTEST   |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(14,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(14,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(15,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(17,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(18,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(18,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(24,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(24,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(25,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(27,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(28,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(28,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(34,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(34,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(35,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(7,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(8,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(8,7)     |GRANT|ACTIVE  
+ij> delete from aborttest where keycol >= 3 ;
+70 rows inserted/updated/deleted
+ij> -- check to make sure we escalated;
+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  |ABORTTEST   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |3   |X   |ABORTTEST   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |ABORTTEST   |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(14,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(14,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(15,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(17,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(18,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(18,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(24,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(24,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(25,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(27,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(28,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(28,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(34,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(34,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(35,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(7,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(8,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(8,7)     |GRANT|ACTIVE  
+ij> -- now cause space reclamation on the leftmost leaf
+insert into aborttest values (-1, '-1'), (-1, '-1');
+2 rows inserted/updated/deleted
+ij> -- check to make sure we escalated;
+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   |IX  |ABORTTEST   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |3   |X   |ABORTTEST   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |ABORTTEST   |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(11,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(14,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(14,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(15,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(17,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(18,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(18,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(2,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(21,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(24,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(24,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(25,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(27,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(28,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(28,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(3,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(31,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(34,7)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(34,8)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(35,6)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(4,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(7,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(8,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |ABORTTEST   |(8,7)     |GRANT|ACTIVE  
+ij> -- Before fix to bug 4328/4330 the following rollback would cause a recovery
+-- error which would shut down the server, and cause recovery to always fail.
+-- The problem was that the lock escalation bug would remove locks on 
+-- uncommitted deleted rows, and then the above insert would try and succeed
+-- at purging rows that it should not have been able.  When undo comes along to
+-- undo the delete it can't find the row because it has been purged by a
+-- committed nested internal transaction.
+rollback;
+ij> select count(*) from aborttest;
+1          
+-----------
+110        
+ij> select keycol from aborttest;
+KEYCOL     
+-----------
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+0          
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+ij> commit;
+ij> -- TEST 4 - (beetle 4764) make sure no lock timeout if escalate is blocked by 
+-- another user.
+-- 
+connect 'wombat' as block_escalate_connection;
+ij(BLOCK_ESCALATE_CONNECTION)> set connection block_escalate_connection;
+ij(BLOCK_ESCALATE_CONNECTION)> autocommit off;
+ij(BLOCK_ESCALATE_CONNECTION)> drop table foo;
+0 rows inserted/updated/deleted
+ij(BLOCK_ESCALATE_CONNECTION)> create table foo (a int, data char(10));
+0 rows inserted/updated/deleted
+ij(BLOCK_ESCALATE_CONNECTION)> commit;
+ij(BLOCK_ESCALATE_CONNECTION)> insert into foo values (1, 'blocker');
+1 row inserted/updated/deleted
+ij(BLOCK_ESCALATE_CONNECTION)> connect 'wombat' as escalate_connection;
+ij(ESCALATE_CONNECTION)> set connection escalate_connection;
+ij(ESCALATE_CONNECTION)> autocommit off;
+ij(ESCALATE_CONNECTION)> commit;
+ij(ESCALATE_CONNECTION)> -- insert 100 rows which should try to escalate the lock but then fail, because
+-- it is blocked by the block_escalate_connection
+insert into foo values (0, '0'), (0, '1'), (0, '2'), (0, '3'), (0, '4'), (0, '5'), (0, '6'), (0, '7'), (0, '8'), (0, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (10, '0'), (11, '1'), (12, '2'), (13, '3'), (14, '4'), (15, '5'), (16, '6'), (17, '7'), (18, '8'), (19, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (20, '0'), (21, '1'), (22, '2'), (23, '3'), (24, '4'), (25, '5'), (26, '6'), (27, '7'), (28, '8'), (29, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (30, '0'), (31, '1'), (32, '2'), (33, '3'), (34, '4'), (35, '5'), (36, '6'), (37, '7'), (38, '8'), (39, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (40, '0'), (41, '1'), (42, '2'), (43, '3'), (44, '4'), (45, '5'), (46, '6'), (47, '7'), (48, '8'), (49, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (50, '0'), (51, '1'), (52, '2'), (53, '3'), (54, '4'), (55, '5'), (56, '6'), (57, '7'), (58, '8'), (59, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (60, '0'), (61, '1'), (62, '2'), (63, '3'), (64, '4'), (65, '5'), (66, '6'), (67, '7'), (68, '8'), (69, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (70, '0'), (71, '1'), (72, '2'), (73, '3'), (74, '4'), (75, '5'), (76, '6'), (77, '7'), (78, '8'), (79, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (80, '0'), (81, '1'), (82, '2'), (83, '3'), (84, '4'), (85, '5'), (86, '6'), (87, '7'), (88, '8'), (89, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (90, '0'), (91, '1'), (92, '2'), (93, '3'), (94, '4'), (95, '5'), (96, '6'), (97, '7'), (98, '8'), (99, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> insert into foo values (100, '0'), (101, '1'), (102, '2'), (103, '3'), (104, '4'), (105, '5'), (106, '6'), (107, '7'), (108, '8'), (109, '9');
+10 rows inserted/updated/deleted
+ij(ESCALATE_CONNECTION)> -- check to make sure we have not escalated;
+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  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |11  |IX  |FOO         |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,100)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,101)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,102)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,103)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,104)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,105)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,106)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,107)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,108)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,109)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,110)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,111)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,112)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,113)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,114)   |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,14)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,15)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,16)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,17)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,18)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,19)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,20)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,21)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,22)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,23)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,24)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,25)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,26)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,27)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,28)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,29)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,30)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,31)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,32)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,33)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,34)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,35)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,36)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,37)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,38)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,39)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,40)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,41)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,42)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,43)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,44)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,45)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,46)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,47)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,48)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,49)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,50)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,51)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,52)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,53)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,54)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,55)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,56)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,57)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,58)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,59)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,60)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,61)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,62)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,63)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,64)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,65)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,66)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,67)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,68)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,69)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,70)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,71)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,72)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,73)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,74)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,75)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,76)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,77)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,78)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,79)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,80)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,81)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,82)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,83)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,84)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,85)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,86)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,87)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,88)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,89)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,90)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,91)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,92)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,93)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,94)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,95)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,96)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,97)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,98)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(1,99)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |FOO         |(2,8)     |GRANT|ACTIVE  
+ij(ESCALATE_CONNECTION)> commit;
+ij(ESCALATE_CONNECTION)> set connection block_escalate_connection;
+ij(BLOCK_ESCALATE_CONNECTION)> commit;
+ij(BLOCK_ESCALATE_CONNECTION)> -- see if all the data made it.
+select a, data from foo;
+A          |DATA      
+----------------------
+1          |blocker   
+0          |0         
+0          |1         
+0          |2         
+0          |3         
+0          |4         
+0          |5         
+0          |6         
+0          |7         
+0          |8         
+0          |9         
+10         |0         
+11         |1         
+12         |2         
+13         |3         
+14         |4         
+15         |5         
+16         |6         
+17         |7         
+18         |8         
+19         |9         
+20         |0         
+21         |1         
+22         |2         
+23         |3         
+24         |4         
+25         |5         
+26         |6         
+27         |7         
+28         |8         
+29         |9         
+30         |0         
+31         |1         
+32         |2         
+33         |3         
+34         |4         
+35         |5         
+36         |6         
+37         |7         
+38         |8         
+39         |9         
+40         |0         
+41         |1         
+42         |2         
+43         |3         
+44         |4         
+45         |5         
+46         |6         
+47         |7         
+48         |8         
+49         |9         
+50         |0         
+51         |1         
+52         |2         
+53         |3         
+54         |4         
+55         |5         
+56         |6         
+57         |7         
+58         |8         
+59         |9         
+60         |0         
+61         |1         
+62         |2         
+63         |3         
+64         |4         
+65         |5         
+66         |6         
+67         |7         
+68         |8         
+69         |9         
+70         |0         
+71         |1         
+72         |2         
+73         |3         
+74         |4         
+75         |5         
+76         |6         
+77         |7         
+78         |8         
+79         |9         
+80         |0         
+81         |1         
+82         |2         
+83         |3         
+84         |4         
+85         |5         
+86         |6         
+87         |7         
+88         |8         
+89         |9         
+90         |0         
+91         |1         
+92         |2         
+93         |3         
+94         |4         
+95         |5         
+96         |6         
+97         |7         
+98         |8         
+99         |9         
+100        |0         
+101        |1         
+102        |2         
+103        |3         
+104        |4         
+105        |5         
+106        |6         
+107        |7         
+108        |8         
+109        |9         
+ij(BLOCK_ESCALATE_CONNECTION)> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/LOBTest.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3873 @@
+create table bit_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol char (8 ) for bit data )
+insert into bit_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS char (8 ) for bit data) )
+insert into bit_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into bit_table ( col_1 ) values ( 'true' )
+insert into bit_table ( col_2 ) values ( 'true' )
+insert into bit_table ( col_3 ) values ( 'true' )
+insert into bit_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into bit_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into bit_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into bit_table ( typecol ) values cast ( X'0074007200750065'  AS char (8 ) for bit data)
+=== Columntype int
+select col_0 from bit_table
+	0 getObject            ->'100'    	: java.lang.Integer
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->'100'    	: java.math.BigDecimal
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'true'    	: java.lang.Boolean
+	0 getByte              ->'100'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'INTEGER'.)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'INTEGER'.)
+	0 getDouble            ->'100.0'    	: java.lang.Double
+	0 getFloat             ->'100.0'    	: java.lang.Float
+	0 getInt               ->'100'    	: java.lang.Integer
+	0 getLong              ->'100'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'100'    	: java.lang.Short
+	0 getString            ->'100'    	: java.lang.String
+	0 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'INTEGER'.)
+	0 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'INTEGER'.)
+=== Columntype char(10)
+select col_1 from bit_table
+	1 getObject            ->'101       '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->'101'    	: java.math.BigDecimal
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->'101'    	: java.lang.Byte
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->'101.0'    	: java.lang.Double
+	1 getFloat             ->'101.0'    	: java.lang.Float
+	1 getInt               ->'101'    	: java.lang.Integer
+	1 getLong              ->'101'    	: java.lang.Long
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->'101'    	: java.lang.Short
+	1 getString            ->'101       '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from bit_table
+	2 getObject            ->'102'    	: java.lang.String
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->Object'   	: java.io.InputStream
+	2 getBigDecimal        ->'102'    	: java.math.BigDecimal
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'true'    	: java.lang.Boolean
+	2 getByte              ->'102'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'VARCHAR'.)
+	2 getCharacterStream   ->Object'   	: java.io.Reader
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getDouble            ->'102.0'    	: java.lang.Double
+	2 getFloat             ->'102.0'    	: java.lang.Float
+	2 getInt               ->'102'    	: java.lang.Integer
+	2 getLong              ->'102'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'102'    	: java.lang.Short
+	2 getString            ->'102'    	: java.lang.String
+	2 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype long varchar
+select col_3 from bit_table
+	3 getObject            ->'103'    	: java.lang.String
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->Object'   	: java.io.InputStream
+	3 getBigDecimal        ->'103'    	: java.math.BigDecimal
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'true'    	: java.lang.Boolean
+	3 getByte              ->'103'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'LONG VARCHAR'.)
+	3 getCharacterStream   ->Object'   	: java.io.Reader
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getDouble            ->'103.0'    	: java.lang.Double
+	3 getFloat             ->'103.0'    	: java.lang.Float
+	3 getInt               ->'103'    	: java.lang.Integer
+	3 getLong              ->'103'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'103'    	: java.lang.Short
+	3 getString            ->'103'    	: java.lang.String
+	3 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype char(10) for bit data
+select col_4 from bit_table
+	4 getObject            ->Object'   	: byte[]
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->Object'   	: java.io.InputStream
+	4 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBinaryStream      ->Object'   	: java.io.InputStream
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBytes             ->Object'   	: byte[]
+	4 getCharacterStream   ->Object'   	: java.io.Reader
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getString            ->'00310030003420202020'    	: java.lang.String
+	4 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+=== Columntype long varchar for bit data
+select col_5 from bit_table
+	5 getObject            ->Object'   	: byte[]
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->Object'   	: java.io.InputStream
+	5 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBinaryStream      ->Object'   	: java.io.InputStream
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBytes             ->Object'   	: byte[]
+	5 getCharacterStream   ->Object'   	: java.io.Reader
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getString            ->'003100300035'    	: java.lang.String
+	5 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+=== Columntype blob(80)
+select col_6 from bit_table
+	6 getObject            ->Object'   	: java.sql.Blob
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->Object'   	: java.io.InputStream
+	6 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	6 getBinaryStream      ->Object'   	: java.io.InputStream
+	6 getBlob              ->Object'   	: java.sql.Blob
+	6 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	6 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	6 getBytes             ->Object'   	: byte[]
+	6 getCharacterStream   ->Object'   	: java.io.Reader
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	6 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	6 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	6 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	6 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	6 getString            ->'003100300036'    	: java.lang.String
+	6 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	6 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+=== Columntype char (8 ) for bit data
+select typecol from bit_table
+	7 getObject            ->Object'   	: byte[]
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->Object'   	: java.io.InputStream
+	7 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getBinaryStream      ->Object'   	: java.io.InputStream
+	7 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getBytes             ->Object'   	: byte[]
+	7 getCharacterStream   ->Object'   	: java.io.Reader
+	7 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getString            ->'0031003000372020'    	: java.lang.String
+	7 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+---< METADATA TESTS
+select col_0 from bit_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '100' : java.lang.Integer
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from bit_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '101       ' : java.lang.String
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from bit_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '102' : java.lang.String
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from bit_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '103' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from bit_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_5 from bit_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_6 from bit_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select typecol from bit_table
+	---- 1
+	Column    : TYPECOL
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : TYPECOL
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'CHAR () FOR BIT DATA'.
+select cast( col_1 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR' to 'CHAR () FOR BIT DATA'.
+select cast( col_2 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'VARCHAR' to 'CHAR () FOR BIT DATA'.
+select cast( col_3 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR' to 'CHAR () FOR BIT DATA'.
+select cast( col_4 as char (8) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_5 as char (8) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select cast( col_6 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as char (8) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'INTEGER'.
+select cast( typecol as char(10) ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CHAR'.
+select cast( typecol as varchar(80) ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'VARCHAR'.
+select cast( typecol as long varchar ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'LONG VARCHAR'.
+select cast( typecol as char(10) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+select cast( typecol as long varchar for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+select cast( typecol as blob(80) ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select cast( typecol as char (8 ) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+drop table bit_table
+create table bit_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol char (8 ) for bit data )
+insert into bit_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS char (8 ) for bit data) )
+insert into bit_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into bit_table ( col_1 ) values ( 'true' )
+insert into bit_table ( col_2 ) values ( 'true' )
+insert into bit_table ( col_3 ) values ( 'true' )
+insert into bit_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into bit_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into bit_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into bit_table ( typecol ) values cast ( X'0074007200750065'  AS char (8 ) for bit data)
+=== Columntype int
+select col_0 from bit_table
+	0 getObject            ->'100'    	: java.lang.Integer
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->'100'    	: java.math.BigDecimal
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'true'    	: java.lang.Boolean
+	0 getByte              ->'100'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'INTEGER'.)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'INTEGER'.)
+	0 getDouble            ->'100.0'    	: java.lang.Double
+	0 getFloat             ->'100.0'    	: java.lang.Float
+	0 getInt               ->'100'    	: java.lang.Integer
+	0 getLong              ->'100'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'100'    	: java.lang.Short
+	0 getString            ->'100'    	: java.lang.String
+	0 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'INTEGER'.)
+	0 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'INTEGER'.)
+=== Columntype char(10)
+select col_1 from bit_table
+	1 getObject            ->'101       '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->'101'    	: java.math.BigDecimal
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->'101'    	: java.lang.Byte
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->'101.0'    	: java.lang.Double
+	1 getFloat             ->'101.0'    	: java.lang.Float
+	1 getInt               ->'101'    	: java.lang.Integer
+	1 getLong              ->'101'    	: java.lang.Long
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->'101'    	: java.lang.Short
+	1 getString            ->'101       '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from bit_table
+	2 getObject            ->'102'    	: java.lang.String
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->Object'   	: java.io.InputStream
+	2 getBigDecimal        ->'102'    	: java.math.BigDecimal
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'true'    	: java.lang.Boolean
+	2 getByte              ->'102'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'VARCHAR'.)
+	2 getCharacterStream   ->Object'   	: java.io.Reader
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getDouble            ->'102.0'    	: java.lang.Double
+	2 getFloat             ->'102.0'    	: java.lang.Float
+	2 getInt               ->'102'    	: java.lang.Integer
+	2 getLong              ->'102'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'102'    	: java.lang.Short
+	2 getString            ->'102'    	: java.lang.String
+	2 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype long varchar
+select col_3 from bit_table
+	3 getObject            ->'103'    	: java.lang.String
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->Object'   	: java.io.InputStream
+	3 getBigDecimal        ->'103'    	: java.math.BigDecimal
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'true'    	: java.lang.Boolean
+	3 getByte              ->'103'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'LONG VARCHAR'.)
+	3 getCharacterStream   ->Object'   	: java.io.Reader
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getDouble            ->'103.0'    	: java.lang.Double
+	3 getFloat             ->'103.0'    	: java.lang.Float
+	3 getInt               ->'103'    	: java.lang.Integer
+	3 getLong              ->'103'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'103'    	: java.lang.Short
+	3 getString            ->'103'    	: java.lang.String
+	3 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype char(10) for bit data
+select col_4 from bit_table
+	4 getObject            ->Object'   	: byte[]
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->Object'   	: java.io.InputStream
+	4 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBinaryStream      ->Object'   	: java.io.InputStream
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBytes             ->Object'   	: byte[]
+	4 getCharacterStream   ->Object'   	: java.io.Reader
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getString            ->'00310030003420202020'    	: java.lang.String
+	4 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+=== Columntype long varchar for bit data
+select col_5 from bit_table
+	5 getObject            ->Object'   	: byte[]
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->Object'   	: java.io.InputStream
+	5 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBinaryStream      ->Object'   	: java.io.InputStream
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBytes             ->Object'   	: byte[]
+	5 getCharacterStream   ->Object'   	: java.io.Reader
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getString            ->'003100300035'    	: java.lang.String
+	5 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+=== Columntype blob(80)
+select col_6 from bit_table
+	6 getObject            ->Object'   	: java.sql.Blob
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->Object'   	: java.io.InputStream
+	6 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	6 getBinaryStream      ->Object'   	: java.io.InputStream
+	6 getBlob              ->Object'   	: java.sql.Blob
+	6 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	6 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	6 getBytes             ->Object'   	: byte[]
+	6 getCharacterStream   ->Object'   	: java.io.Reader
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	6 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	6 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	6 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	6 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	6 getString            ->'003100300036'    	: java.lang.String
+	6 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	6 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+=== Columntype char (8 ) for bit data
+select typecol from bit_table
+	7 getObject            ->Object'   	: byte[]
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->Object'   	: java.io.InputStream
+	7 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getBinaryStream      ->Object'   	: java.io.InputStream
+	7 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getBytes             ->Object'   	: byte[]
+	7 getCharacterStream   ->Object'   	: java.io.Reader
+	7 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getString            ->'0031003000372020'    	: java.lang.String
+	7 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	7 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+---< METADATA TESTS
+select col_0 from bit_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '100' : java.lang.Integer
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from bit_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '101       ' : java.lang.String
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from bit_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '102' : java.lang.String
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from bit_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '103' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from bit_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_5 from bit_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_6 from bit_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select typecol from bit_table
+	---- 1
+	Column    : TYPECOL
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : TYPECOL
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'CHAR () FOR BIT DATA'.
+select cast( col_1 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR' to 'CHAR () FOR BIT DATA'.
+select cast( col_2 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'VARCHAR' to 'CHAR () FOR BIT DATA'.
+select cast( col_3 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR' to 'CHAR () FOR BIT DATA'.
+select cast( col_4 as char (8) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_5 as char (8) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select cast( col_6 as char (8) for bit data ) from bit_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as char (8) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'INTEGER'.
+select cast( typecol as char(10) ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CHAR'.
+select cast( typecol as varchar(80) ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'VARCHAR'.
+select cast( typecol as long varchar ) from bit_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'LONG VARCHAR'.
+select cast( typecol as char(10) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+select cast( typecol as long varchar for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+select cast( typecol as blob(80) ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select cast( typecol as char (8 ) for bit data ) from bit_table
+	---- 1
+	Column    : 1
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : 1
+	DisplaySz : 16
+	Precision : 8
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+drop table bit_table
+create table blob_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol blob (2 M) )
+insert into blob_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS blob (2 M)) )
+insert into blob_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into blob_table ( col_1 ) values ( 'true' )
+insert into blob_table ( col_2 ) values ( 'true' )
+insert into blob_table ( col_3 ) values ( 'true' )
+insert into blob_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into blob_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into blob_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into blob_table ( typecol ) values cast ( X'0074007200750065'  AS blob (2 M))
+=== Columntype int
+select col_0 from blob_table
+	0 getObject            ->'100'    	: java.lang.Integer
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->'100'    	: java.math.BigDecimal
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'true'    	: java.lang.Boolean
+	0 getByte              ->'100'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'INTEGER'.)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'INTEGER'.)
+	0 getDouble            ->'100.0'    	: java.lang.Double
+	0 getFloat             ->'100.0'    	: java.lang.Float
+	0 getInt               ->'100'    	: java.lang.Integer
+	0 getLong              ->'100'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'100'    	: java.lang.Short
+	0 getString            ->'100'    	: java.lang.String
+	0 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'INTEGER'.)
+	0 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'INTEGER'.)
+=== Columntype char(10)
+select col_1 from blob_table
+	1 getObject            ->'101       '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->'101'    	: java.math.BigDecimal
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->'101'    	: java.lang.Byte
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->'101.0'    	: java.lang.Double
+	1 getFloat             ->'101.0'    	: java.lang.Float
+	1 getInt               ->'101'    	: java.lang.Integer
+	1 getLong              ->'101'    	: java.lang.Long
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->'101'    	: java.lang.Short
+	1 getString            ->'101       '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from blob_table
+	2 getObject            ->'102'    	: java.lang.String
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->Object'   	: java.io.InputStream
+	2 getBigDecimal        ->'102'    	: java.math.BigDecimal
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'true'    	: java.lang.Boolean
+	2 getByte              ->'102'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'VARCHAR'.)
+	2 getCharacterStream   ->Object'   	: java.io.Reader
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getDouble            ->'102.0'    	: java.lang.Double
+	2 getFloat             ->'102.0'    	: java.lang.Float
+	2 getInt               ->'102'    	: java.lang.Integer
+	2 getLong              ->'102'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'102'    	: java.lang.Short
+	2 getString            ->'102'    	: java.lang.String
+	2 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype long varchar
+select col_3 from blob_table
+	3 getObject            ->'103'    	: java.lang.String
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->Object'   	: java.io.InputStream
+	3 getBigDecimal        ->'103'    	: java.math.BigDecimal
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'true'    	: java.lang.Boolean
+	3 getByte              ->'103'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'LONG VARCHAR'.)
+	3 getCharacterStream   ->Object'   	: java.io.Reader
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getDouble            ->'103.0'    	: java.lang.Double
+	3 getFloat             ->'103.0'    	: java.lang.Float
+	3 getInt               ->'103'    	: java.lang.Integer
+	3 getLong              ->'103'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'103'    	: java.lang.Short
+	3 getString            ->'103'    	: java.lang.String
+	3 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype char(10) for bit data
+select col_4 from blob_table
+	4 getObject            ->Object'   	: byte[]
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->Object'   	: java.io.InputStream
+	4 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBinaryStream      ->Object'   	: java.io.InputStream
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBytes             ->Object'   	: byte[]
+	4 getCharacterStream   ->Object'   	: java.io.Reader
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getString            ->'00310030003420202020'    	: java.lang.String
+	4 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+=== Columntype long varchar for bit data
+select col_5 from blob_table
+	5 getObject            ->Object'   	: byte[]
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->Object'   	: java.io.InputStream
+	5 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBinaryStream      ->Object'   	: java.io.InputStream
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBytes             ->Object'   	: byte[]
+	5 getCharacterStream   ->Object'   	: java.io.Reader
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getString            ->'003100300035'    	: java.lang.String
+	5 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+=== Columntype blob(80)
+select col_6 from blob_table
+	6 getObject            ->Object'   	: java.sql.Blob
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->Object'   	: java.io.InputStream
+	6 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	6 getBinaryStream      ->Object'   	: java.io.InputStream
+	6 getBlob              ->Object'   	: java.sql.Blob
+	6 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	6 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	6 getBytes             ->Object'   	: byte[]
+	6 getCharacterStream   ->Object'   	: java.io.Reader
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	6 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	6 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	6 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	6 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	6 getString            ->'003100300036'    	: java.lang.String
+	6 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	6 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+=== Columntype blob (2 M)
+select typecol from blob_table
+	7 getObject            ->Object'   	: java.sql.Blob
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->Object'   	: java.io.InputStream
+	7 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	7 getBinaryStream      ->Object'   	: java.io.InputStream
+	7 getBlob              ->Object'   	: java.sql.Blob
+	7 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	7 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	7 getBytes             ->Object'   	: byte[]
+	7 getCharacterStream   ->Object'   	: java.io.Reader
+	7 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	7 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	7 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	7 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	7 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	7 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	7 getString            ->'003100300037'    	: java.lang.String
+	7 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	7 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+---< METADATA TESTS
+select col_0 from blob_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '100' : java.lang.Integer
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from blob_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '101       ' : java.lang.String
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from blob_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '102' : java.lang.String
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from blob_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '103' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from blob_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_5 from blob_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_6 from blob_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select typecol from blob_table
+	---- 1
+	Column    : TYPECOL
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : TYPECOL
+	DisplaySz : 4194304
+	Precision : 2097152
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as blob(2 M) ) from blob_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'BLOB'.
+select cast( col_1 as blob(2 M) ) from blob_table
+	SQL Exception: Cannot convert types 'CHAR' to 'BLOB'.
+select cast( col_2 as blob(2 M) ) from blob_table
+	SQL Exception: Cannot convert types 'VARCHAR' to 'BLOB'.
+select cast( col_3 as blob(2 M) ) from blob_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR' to 'BLOB'.
+select cast( col_4 as blob(2 M) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4194304
+	Precision : 2097152
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_5 as blob(2 M) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4194304
+	Precision : 2097152
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+select cast( col_6 as blob(2 M) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4194304
+	Precision : 2097152
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select cast( typecol as blob(2 M) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4194304
+	Precision : 2097152
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'INTEGER'.
+select cast( typecol as char(10) ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR'.
+select cast( typecol as varchar(80) ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'VARCHAR'.
+select cast( typecol as long varchar ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'LONG VARCHAR'.
+select cast( typecol as char(10) for bit data ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as long varchar for bit data ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'LONG VARCHAR FOR BIT DATA'.
+select cast( typecol as blob(80) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select cast( typecol as blob (2 M) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4194304
+	Precision : 2097152
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+drop table blob_table
+create table blob_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol blob (2 K) )
+insert into blob_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS blob (2 K)) )
+insert into blob_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into blob_table ( col_1 ) values ( 'true' )
+insert into blob_table ( col_2 ) values ( 'true' )
+insert into blob_table ( col_3 ) values ( 'true' )
+insert into blob_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into blob_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into blob_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into blob_table ( typecol ) values cast ( X'0074007200750065'  AS blob (2 K))
+=== Columntype int
+select col_0 from blob_table
+	0 getObject            ->'100'    	: java.lang.Integer
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->'100'    	: java.math.BigDecimal
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'true'    	: java.lang.Boolean
+	0 getByte              ->'100'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'INTEGER'.)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'INTEGER'.)
+	0 getDouble            ->'100.0'    	: java.lang.Double
+	0 getFloat             ->'100.0'    	: java.lang.Float
+	0 getInt               ->'100'    	: java.lang.Integer
+	0 getLong              ->'100'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'100'    	: java.lang.Short
+	0 getString            ->'100'    	: java.lang.String
+	0 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'INTEGER'.)
+	0 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'INTEGER'.)
+=== Columntype char(10)
+select col_1 from blob_table
+	1 getObject            ->'101       '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->'101'    	: java.math.BigDecimal
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->'101'    	: java.lang.Byte
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->'101.0'    	: java.lang.Double
+	1 getFloat             ->'101.0'    	: java.lang.Float
+	1 getInt               ->'101'    	: java.lang.Integer
+	1 getLong              ->'101'    	: java.lang.Long
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->'101'    	: java.lang.Short
+	1 getString            ->'101       '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from blob_table
+	2 getObject            ->'102'    	: java.lang.String
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->Object'   	: java.io.InputStream
+	2 getBigDecimal        ->'102'    	: java.math.BigDecimal
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'true'    	: java.lang.Boolean
+	2 getByte              ->'102'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'VARCHAR'.)
+	2 getCharacterStream   ->Object'   	: java.io.Reader
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getDouble            ->'102.0'    	: java.lang.Double
+	2 getFloat             ->'102.0'    	: java.lang.Float
+	2 getInt               ->'102'    	: java.lang.Integer
+	2 getLong              ->'102'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'102'    	: java.lang.Short
+	2 getString            ->'102'    	: java.lang.String
+	2 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype long varchar
+select col_3 from blob_table
+	3 getObject            ->'103'    	: java.lang.String
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->Object'   	: java.io.InputStream
+	3 getBigDecimal        ->'103'    	: java.math.BigDecimal
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'true'    	: java.lang.Boolean
+	3 getByte              ->'103'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'LONG VARCHAR'.)
+	3 getCharacterStream   ->Object'   	: java.io.Reader
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getDouble            ->'103.0'    	: java.lang.Double
+	3 getFloat             ->'103.0'    	: java.lang.Float
+	3 getInt               ->'103'    	: java.lang.Integer
+	3 getLong              ->'103'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'103'    	: java.lang.Short
+	3 getString            ->'103'    	: java.lang.String
+	3 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype char(10) for bit data
+select col_4 from blob_table
+	4 getObject            ->Object'   	: byte[]
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->Object'   	: java.io.InputStream
+	4 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBinaryStream      ->Object'   	: java.io.InputStream
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBytes             ->Object'   	: byte[]
+	4 getCharacterStream   ->Object'   	: java.io.Reader
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getString            ->'00310030003420202020'    	: java.lang.String
+	4 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+=== Columntype long varchar for bit data
+select col_5 from blob_table
+	5 getObject            ->Object'   	: byte[]
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->Object'   	: java.io.InputStream
+	5 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBinaryStream      ->Object'   	: java.io.InputStream
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBytes             ->Object'   	: byte[]
+	5 getCharacterStream   ->Object'   	: java.io.Reader
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getString            ->'003100300035'    	: java.lang.String
+	5 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+=== Columntype blob(80)
+select col_6 from blob_table
+	6 getObject            ->Object'   	: java.sql.Blob
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->Object'   	: java.io.InputStream
+	6 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	6 getBinaryStream      ->Object'   	: java.io.InputStream
+	6 getBlob              ->Object'   	: java.sql.Blob
+	6 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	6 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	6 getBytes             ->Object'   	: byte[]
+	6 getCharacterStream   ->Object'   	: java.io.Reader
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	6 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	6 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	6 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	6 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	6 getString            ->'003100300036'    	: java.lang.String
+	6 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	6 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+=== Columntype blob (2 K)
+select typecol from blob_table
+	7 getObject            ->Object'   	: java.sql.Blob
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->Object'   	: java.io.InputStream
+	7 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	7 getBinaryStream      ->Object'   	: java.io.InputStream
+	7 getBlob              ->Object'   	: java.sql.Blob
+	7 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	7 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	7 getBytes             ->Object'   	: byte[]
+	7 getCharacterStream   ->Object'   	: java.io.Reader
+	7 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	7 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	7 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	7 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	7 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	7 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	7 getString            ->'003100300037'    	: java.lang.String
+	7 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	7 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+---< METADATA TESTS
+select col_0 from blob_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '100' : java.lang.Integer
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from blob_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '101       ' : java.lang.String
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from blob_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '102' : java.lang.String
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from blob_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '103' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from blob_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_5 from blob_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_6 from blob_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select typecol from blob_table
+	---- 1
+	Column    : TYPECOL
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : TYPECOL
+	DisplaySz : 4096
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as blob(2 K) ) from blob_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'BLOB'.
+select cast( col_1 as blob(2 K) ) from blob_table
+	SQL Exception: Cannot convert types 'CHAR' to 'BLOB'.
+select cast( col_2 as blob(2 K) ) from blob_table
+	SQL Exception: Cannot convert types 'VARCHAR' to 'BLOB'.
+select cast( col_3 as blob(2 K) ) from blob_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR' to 'BLOB'.
+select cast( col_4 as blob(2 K) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4096
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_5 as blob(2 K) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4096
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+select cast( col_6 as blob(2 K) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4096
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select cast( typecol as blob(2 K) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4096
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'INTEGER'.
+select cast( typecol as char(10) ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR'.
+select cast( typecol as varchar(80) ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'VARCHAR'.
+select cast( typecol as long varchar ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'LONG VARCHAR'.
+select cast( typecol as char(10) for bit data ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as long varchar for bit data ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'LONG VARCHAR FOR BIT DATA'.
+select cast( typecol as blob(80) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select cast( typecol as blob (2 K) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 4096
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+drop table blob_table
+create table blob_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol blob (64  ) )
+insert into blob_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS blob (64  )) )
+insert into blob_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into blob_table ( col_1 ) values ( 'true' )
+insert into blob_table ( col_2 ) values ( 'true' )
+insert into blob_table ( col_3 ) values ( 'true' )
+insert into blob_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into blob_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into blob_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into blob_table ( typecol ) values cast ( X'0074007200750065'  AS blob (64  ))
+=== Columntype int
+select col_0 from blob_table
+	0 getObject            ->'100'    	: java.lang.Integer
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->'100'    	: java.math.BigDecimal
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'true'    	: java.lang.Boolean
+	0 getByte              ->'100'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'INTEGER'.)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'INTEGER'.)
+	0 getDouble            ->'100.0'    	: java.lang.Double
+	0 getFloat             ->'100.0'    	: java.lang.Float
+	0 getInt               ->'100'    	: java.lang.Integer
+	0 getLong              ->'100'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'100'    	: java.lang.Short
+	0 getString            ->'100'    	: java.lang.String
+	0 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'INTEGER'.)
+	0 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'INTEGER'.)
+=== Columntype char(10)
+select col_1 from blob_table
+	1 getObject            ->'101       '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->'101'    	: java.math.BigDecimal
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->'101'    	: java.lang.Byte
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->'101.0'    	: java.lang.Double
+	1 getFloat             ->'101.0'    	: java.lang.Float
+	1 getInt               ->'101'    	: java.lang.Integer
+	1 getLong              ->'101'    	: java.lang.Long
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->'101'    	: java.lang.Short
+	1 getString            ->'101       '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from blob_table
+	2 getObject            ->'102'    	: java.lang.String
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->Object'   	: java.io.InputStream
+	2 getBigDecimal        ->'102'    	: java.math.BigDecimal
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'true'    	: java.lang.Boolean
+	2 getByte              ->'102'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'VARCHAR'.)
+	2 getCharacterStream   ->Object'   	: java.io.Reader
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getDouble            ->'102.0'    	: java.lang.Double
+	2 getFloat             ->'102.0'    	: java.lang.Float
+	2 getInt               ->'102'    	: java.lang.Integer
+	2 getLong              ->'102'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'102'    	: java.lang.Short
+	2 getString            ->'102'    	: java.lang.String
+	2 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	2 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype long varchar
+select col_3 from blob_table
+	3 getObject            ->'103'    	: java.lang.String
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->Object'   	: java.io.InputStream
+	3 getBigDecimal        ->'103'    	: java.math.BigDecimal
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'true'    	: java.lang.Boolean
+	3 getByte              ->'103'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'LONG VARCHAR'.)
+	3 getCharacterStream   ->Object'   	: java.io.Reader
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getDouble            ->'103.0'    	: java.lang.Double
+	3 getFloat             ->'103.0'    	: java.lang.Float
+	3 getInt               ->'103'    	: java.lang.Integer
+	3 getLong              ->'103'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'103'    	: java.lang.Short
+	3 getString            ->'103'    	: java.lang.String
+	3 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	3 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype char(10) for bit data
+select col_4 from blob_table
+	4 getObject            ->Object'   	: byte[]
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->Object'   	: java.io.InputStream
+	4 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBinaryStream      ->Object'   	: java.io.InputStream
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBytes             ->Object'   	: byte[]
+	4 getCharacterStream   ->Object'   	: java.io.Reader
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getString            ->'00310030003420202020'    	: java.lang.String
+	4 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'CHAR () FOR BIT DATA'.)
+=== Columntype long varchar for bit data
+select col_5 from blob_table
+	5 getObject            ->Object'   	: byte[]
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->Object'   	: java.io.InputStream
+	5 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBinaryStream      ->Object'   	: java.io.InputStream
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBytes             ->Object'   	: byte[]
+	5 getCharacterStream   ->Object'   	: java.io.Reader
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getString            ->'003100300035'    	: java.lang.String
+	5 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+=== Columntype blob(80)
+select col_6 from blob_table
+	6 getObject            ->Object'   	: java.sql.Blob
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->Object'   	: java.io.InputStream
+	6 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	6 getBinaryStream      ->Object'   	: java.io.InputStream
+	6 getBlob              ->Object'   	: java.sql.Blob
+	6 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	6 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	6 getBytes             ->Object'   	: byte[]
+	6 getCharacterStream   ->Object'   	: java.io.Reader
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	6 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	6 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	6 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	6 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	6 getString            ->'003100300036'    	: java.lang.String
+	6 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	6 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+=== Columntype blob (64  )
+select typecol from blob_table
+	7 getObject            ->Object'   	: java.sql.Blob
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->Object'   	: java.io.InputStream
+	7 getBigDecimal        ->		EXCEPTION (An attempt was made to get a data value of type 'java.math.BigDecimal' from a data value of type 'BLOB'.)
+	7 getBinaryStream      ->Object'   	: java.io.InputStream
+	7 getBlob              ->Object'   	: java.sql.Blob
+	7 getBoolean           ->		EXCEPTION (An attempt was made to get a data value of type 'boolean' from a data value of type 'BLOB'.)
+	7 getByte              ->		EXCEPTION (An attempt was made to get a data value of type 'byte' from a data value of type 'BLOB'.)
+	7 getBytes             ->Object'   	: byte[]
+	7 getCharacterStream   ->Object'   	: java.io.Reader
+	7 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	7 getDate              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Date' from a data value of type 'BLOB'.)
+	7 getDouble            ->		EXCEPTION (An attempt was made to get a data value of type 'double' from a data value of type 'BLOB'.)
+	7 getFloat             ->		EXCEPTION (An attempt was made to get a data value of type 'float' from a data value of type 'BLOB'.)
+	7 getInt               ->		EXCEPTION (An attempt was made to get a data value of type 'int' from a data value of type 'BLOB'.)
+	7 getLong              ->		EXCEPTION (An attempt was made to get a data value of type 'long' from a data value of type 'BLOB'.)
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->		EXCEPTION (An attempt was made to get a data value of type 'short' from a data value of type 'BLOB'.)
+	7 getString            ->'003100300037'    	: java.lang.String
+	7 getTime              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Time' from a data value of type 'BLOB'.)
+	7 getTimeStamp         ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Timestamp' from a data value of type 'BLOB'.)
+---< METADATA TESTS
+select col_0 from blob_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '100' : java.lang.Integer
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from blob_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '101       ' : java.lang.String
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from blob_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '102' : java.lang.String
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from blob_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = '103' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from blob_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_5 from blob_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_6 from blob_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select typecol from blob_table
+	---- 1
+	Column    : TYPECOL
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : TYPECOL
+	DisplaySz : 128
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as blob(64  ) ) from blob_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'BLOB'.
+select cast( col_1 as blob(64  ) ) from blob_table
+	SQL Exception: Cannot convert types 'CHAR' to 'BLOB'.
+select cast( col_2 as blob(64  ) ) from blob_table
+	SQL Exception: Cannot convert types 'VARCHAR' to 'BLOB'.
+select cast( col_3 as blob(64  ) ) from blob_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR' to 'BLOB'.
+select cast( col_4 as blob(64  ) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 128
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_5 as blob(64  ) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 128
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+select cast( col_6 as blob(64  ) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 128
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+select cast( typecol as blob(64  ) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 128
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'INTEGER'.
+select cast( typecol as char(10) ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR'.
+select cast( typecol as varchar(80) ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'VARCHAR'.
+select cast( typecol as long varchar ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'LONG VARCHAR'.
+select cast( typecol as char(10) for bit data ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as long varchar for bit data ) from blob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'LONG VARCHAR FOR BIT DATA'.
+select cast( typecol as blob(80) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select cast( typecol as blob (64  ) ) from blob_table
+	---- 1
+	Column    : 1
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : 1
+	DisplaySz : 128
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Blob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+drop table blob_table
+create table clob_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol clob (2 K) )
+insert into clob_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS clob (2 K)) )
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CLOB'.
+insert into clob_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into clob_table ( col_1 ) values ( 'true' )
+insert into clob_table ( col_2 ) values ( 'true' )
+insert into clob_table ( col_3 ) values ( 'true' )
+insert into clob_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into clob_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into clob_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into clob_table ( typecol ) values cast ( X'0074007200750065'  AS clob (2 K))
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CLOB'.
+=== Columntype int
+select col_0 from clob_table
+	0 getObject            ->		EXCEPTION (null)
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->		EXCEPTION (null)
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'false'    	: java.lang.Boolean
+	0 getByte              ->'0'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (null)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (null)
+	0 getDouble            ->'0.0'    	: java.lang.Double
+	0 getFloat             ->'0.0'    	: java.lang.Float
+	0 getInt               ->'0'    	: java.lang.Integer
+	0 getLong              ->'0'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'0'    	: java.lang.Short
+	0 getString            ->		EXCEPTION (null)
+	0 getTime              ->		EXCEPTION (null)
+	0 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype char(10)
+select col_1 from clob_table
+	1 getObject            ->'true      '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->		EXCEPTION (Invalid character string format for type java.math.BigDecimal.)
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->		EXCEPTION (Invalid character string format for type byte.)
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->		EXCEPTION (Invalid character string format for type double.)
+	1 getFloat             ->		EXCEPTION (Invalid character string format for type float.)
+	1 getInt               ->		EXCEPTION (Invalid character string format for type int.)
+	1 getLong              ->		EXCEPTION (Invalid character string format for type long.)
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->		EXCEPTION (Invalid character string format for type short.)
+	1 getString            ->'true      '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from clob_table
+	2 getObject            ->		EXCEPTION (null)
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->		EXCEPTION (null)
+	2 getBigDecimal        ->		EXCEPTION (null)
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'false'    	: java.lang.Boolean
+	2 getByte              ->'0'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (null)
+	2 getCharacterStream   ->		EXCEPTION (null)
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (null)
+	2 getDouble            ->'0.0'    	: java.lang.Double
+	2 getFloat             ->'0.0'    	: java.lang.Float
+	2 getInt               ->'0'    	: java.lang.Integer
+	2 getLong              ->'0'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'0'    	: java.lang.Short
+	2 getString            ->		EXCEPTION (null)
+	2 getTime              ->		EXCEPTION (null)
+	2 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype long varchar
+select col_3 from clob_table
+	3 getObject            ->		EXCEPTION (null)
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->		EXCEPTION (null)
+	3 getBigDecimal        ->		EXCEPTION (null)
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'false'    	: java.lang.Boolean
+	3 getByte              ->'0'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (null)
+	3 getCharacterStream   ->		EXCEPTION (null)
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (null)
+	3 getDouble            ->'0.0'    	: java.lang.Double
+	3 getFloat             ->'0.0'    	: java.lang.Float
+	3 getInt               ->'0'    	: java.lang.Integer
+	3 getLong              ->'0'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'0'    	: java.lang.Short
+	3 getString            ->		EXCEPTION (null)
+	3 getTime              ->		EXCEPTION (null)
+	3 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype char(10) for bit data
+select col_4 from clob_table
+	4 getObject            ->		EXCEPTION (null)
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->		EXCEPTION (null)
+	4 getBigDecimal        ->		EXCEPTION (null)
+	4 getBinaryStream      ->		EXCEPTION (null)
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->'false'    	: java.lang.Boolean
+	4 getByte              ->'0'    	: java.lang.Byte
+	4 getBytes             ->		EXCEPTION (null)
+	4 getCharacterStream   ->		EXCEPTION (null)
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (null)
+	4 getDouble            ->'0.0'    	: java.lang.Double
+	4 getFloat             ->'0.0'    	: java.lang.Float
+	4 getInt               ->'0'    	: java.lang.Integer
+	4 getLong              ->'0'    	: java.lang.Long
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->'0'    	: java.lang.Short
+	4 getString            ->		EXCEPTION (null)
+	4 getTime              ->		EXCEPTION (null)
+	4 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype long varchar for bit data
+select col_5 from clob_table
+	5 getObject            ->		EXCEPTION (null)
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->		EXCEPTION (null)
+	5 getBigDecimal        ->		EXCEPTION (null)
+	5 getBinaryStream      ->		EXCEPTION (null)
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->'false'    	: java.lang.Boolean
+	5 getByte              ->'0'    	: java.lang.Byte
+	5 getBytes             ->		EXCEPTION (null)
+	5 getCharacterStream   ->		EXCEPTION (null)
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (null)
+	5 getDouble            ->'0.0'    	: java.lang.Double
+	5 getFloat             ->'0.0'    	: java.lang.Float
+	5 getInt               ->'0'    	: java.lang.Integer
+	5 getLong              ->'0'    	: java.lang.Long
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->'0'    	: java.lang.Short
+	5 getString            ->		EXCEPTION (null)
+	5 getTime              ->		EXCEPTION (null)
+	5 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype blob(80)
+select col_6 from clob_table
+	6 getObject            ->		EXCEPTION (null)
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->		EXCEPTION (null)
+	6 getBigDecimal        ->		EXCEPTION (null)
+	6 getBinaryStream      ->		EXCEPTION (null)
+	6 getBlob              ->		EXCEPTION (null)
+	6 getBoolean           ->'false'    	: java.lang.Boolean
+	6 getByte              ->'0'    	: java.lang.Byte
+	6 getBytes             ->		EXCEPTION (null)
+	6 getCharacterStream   ->		EXCEPTION (null)
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (null)
+	6 getDouble            ->'0.0'    	: java.lang.Double
+	6 getFloat             ->'0.0'    	: java.lang.Float
+	6 getInt               ->'0'    	: java.lang.Integer
+	6 getLong              ->'0'    	: java.lang.Long
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->'0'    	: java.lang.Short
+	6 getString            ->		EXCEPTION (null)
+	6 getTime              ->		EXCEPTION (null)
+	6 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype clob (2 K)
+select typecol from clob_table
+	7 getObject            ->		EXCEPTION (null)
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->		EXCEPTION (null)
+	7 getBigDecimal        ->		EXCEPTION (null)
+	7 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CLOB'.)
+	7 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CLOB'.)
+	7 getBoolean           ->'false'    	: java.lang.Boolean
+	7 getByte              ->'0'    	: java.lang.Byte
+	7 getBytes             ->		EXCEPTION (null)
+	7 getCharacterStream   ->		EXCEPTION (null)
+	7 getClob              ->		EXCEPTION (null)
+	7 getDate              ->		EXCEPTION (null)
+	7 getDouble            ->'0.0'    	: java.lang.Double
+	7 getFloat             ->'0.0'    	: java.lang.Float
+	7 getInt               ->'0'    	: java.lang.Integer
+	7 getLong              ->'0'    	: java.lang.Long
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->'0'    	: java.lang.Short
+	7 getString            ->		EXCEPTION (null)
+	7 getTime              ->		EXCEPTION (null)
+	7 getTimeStamp         ->		EXCEPTION (null)
+---< METADATA TESTS
+select col_0 from clob_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from clob_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from clob_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from clob_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from clob_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_5 from clob_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+select col_6 from clob_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select typecol from clob_table
+	---- 1
+	Column    : TYPECOL
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : TYPECOL
+	DisplaySz : 2048
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as clob(2 K) ) from clob_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'CLOB'.
+select cast( col_1 as clob(2 K) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 2048
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Clob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_2 as clob(2 K) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 2048
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = Object : java.sql.Clob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_3 as clob(2 K) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 2048
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Clob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_4 as clob(2 K) ) from clob_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CLOB'.
+select cast( col_5 as clob(2 K) ) from clob_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR FOR BIT DATA' to 'CLOB'.
+select cast( col_6 as clob(2 K) ) from clob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CLOB'.
+select cast( typecol as clob(2 K) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 2048
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'INTEGER'.
+select cast( typecol as char(10) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : 1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( typecol as varchar(80) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : 1
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( typecol as long varchar ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : 1
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( typecol as char(10) for bit data ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as long varchar for bit data ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'LONG VARCHAR FOR BIT DATA'.
+select cast( typecol as blob(80) ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'BLOB'.
+select cast( typecol as clob (2 K) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 2048
+	Precision : 2048
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+drop table clob_table
+create table clob_table ( dummy int , col_0 int, col_1 char(10), col_2 varchar(80), col_3 long varchar, col_4 char(10) for bit data, col_5 long varchar for bit data, col_6 blob(80), typecol clob (64  ) )
+insert into clob_table values ( 45 ,100,'101','102','103',X'003100300034',X'003100300035',CAST (X'003100300036' AS blob(80)),CAST (X'003100300037' AS clob (64  )) )
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CLOB'.
+insert into clob_table ( col_0 ) values ( 'true' )
+	SQL Exception: Columns of type 'INTEGER' cannot hold values of type 'CHAR'. 
+insert into clob_table ( col_1 ) values ( 'true' )
+insert into clob_table ( col_2 ) values ( 'true' )
+insert into clob_table ( col_3 ) values ( 'true' )
+insert into clob_table ( col_4 ) values cast ( X'0074007200750065'  AS char(10) for bit data)
+insert into clob_table ( col_5 ) values cast ( X'0074007200750065'  AS long varchar for bit data)
+insert into clob_table ( col_6 ) values cast ( X'0074007200750065'  AS blob(80))
+insert into clob_table ( typecol ) values cast ( X'0074007200750065'  AS clob (64  ))
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CLOB'.
+=== Columntype int
+select col_0 from clob_table
+	0 getObject            ->		EXCEPTION (null)
+	0 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	0 getAsciiStream       ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream(ASCII)' from a data value of type 'INTEGER'.)
+	0 getBigDecimal        ->		EXCEPTION (null)
+	0 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'INTEGER'.)
+	0 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.)
+	0 getBoolean           ->'false'    	: java.lang.Boolean
+	0 getByte              ->'0'    	: java.lang.Byte
+	0 getBytes             ->		EXCEPTION (null)
+	0 getCharacterStream   ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.Reader' from a data value of type 'INTEGER'.)
+	0 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.)
+	0 getDate              ->		EXCEPTION (null)
+	0 getDouble            ->'0.0'    	: java.lang.Double
+	0 getFloat             ->'0.0'    	: java.lang.Float
+	0 getInt               ->'0'    	: java.lang.Integer
+	0 getLong              ->'0'    	: java.lang.Long
+	0 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	0 getShort             ->'0'    	: java.lang.Short
+	0 getString            ->		EXCEPTION (null)
+	0 getTime              ->		EXCEPTION (null)
+	0 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype char(10)
+select col_1 from clob_table
+	1 getObject            ->'true      '    	: java.lang.String
+	1 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	1 getAsciiStream       ->Object'   	: java.io.InputStream
+	1 getBigDecimal        ->		EXCEPTION (Invalid character string format for type java.math.BigDecimal.)
+	1 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CHAR'.)
+	1 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR'.)
+	1 getBoolean           ->'true'    	: java.lang.Boolean
+	1 getByte              ->		EXCEPTION (Invalid character string format for type byte.)
+	1 getBytes             ->		EXCEPTION (An attempt was made to get a data value of type 'byte[]' from a data value of type 'CHAR'.)
+	1 getCharacterStream   ->Object'   	: java.io.Reader
+	1 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR'.)
+	1 getDate              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getDouble            ->		EXCEPTION (Invalid character string format for type double.)
+	1 getFloat             ->		EXCEPTION (Invalid character string format for type float.)
+	1 getInt               ->		EXCEPTION (Invalid character string format for type int.)
+	1 getLong              ->		EXCEPTION (Invalid character string format for type long.)
+	1 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	1 getShort             ->		EXCEPTION (Invalid character string format for type short.)
+	1 getString            ->'true      '    	: java.lang.String
+	1 getTime              ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+	1 getTimeStamp         ->		EXCEPTION (The syntax of the string representation of a datetime value is incorrect.)
+=== Columntype varchar(80)
+select col_2 from clob_table
+	2 getObject            ->		EXCEPTION (null)
+	2 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	2 getAsciiStream       ->		EXCEPTION (null)
+	2 getBigDecimal        ->		EXCEPTION (null)
+	2 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'VARCHAR'.)
+	2 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'VARCHAR'.)
+	2 getBoolean           ->'false'    	: java.lang.Boolean
+	2 getByte              ->'0'    	: java.lang.Byte
+	2 getBytes             ->		EXCEPTION (null)
+	2 getCharacterStream   ->		EXCEPTION (null)
+	2 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'VARCHAR'.)
+	2 getDate              ->		EXCEPTION (null)
+	2 getDouble            ->'0.0'    	: java.lang.Double
+	2 getFloat             ->'0.0'    	: java.lang.Float
+	2 getInt               ->'0'    	: java.lang.Integer
+	2 getLong              ->'0'    	: java.lang.Long
+	2 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	2 getShort             ->'0'    	: java.lang.Short
+	2 getString            ->		EXCEPTION (null)
+	2 getTime              ->		EXCEPTION (null)
+	2 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype long varchar
+select col_3 from clob_table
+	3 getObject            ->		EXCEPTION (null)
+	3 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	3 getAsciiStream       ->		EXCEPTION (null)
+	3 getBigDecimal        ->		EXCEPTION (null)
+	3 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'LONG VARCHAR'.)
+	3 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR'.)
+	3 getBoolean           ->'false'    	: java.lang.Boolean
+	3 getByte              ->'0'    	: java.lang.Byte
+	3 getBytes             ->		EXCEPTION (null)
+	3 getCharacterStream   ->		EXCEPTION (null)
+	3 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR'.)
+	3 getDate              ->		EXCEPTION (null)
+	3 getDouble            ->'0.0'    	: java.lang.Double
+	3 getFloat             ->'0.0'    	: java.lang.Float
+	3 getInt               ->'0'    	: java.lang.Integer
+	3 getLong              ->'0'    	: java.lang.Long
+	3 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	3 getShort             ->'0'    	: java.lang.Short
+	3 getString            ->		EXCEPTION (null)
+	3 getTime              ->		EXCEPTION (null)
+	3 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype char(10) for bit data
+select col_4 from clob_table
+	4 getObject            ->		EXCEPTION (null)
+	4 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	4 getAsciiStream       ->		EXCEPTION (null)
+	4 getBigDecimal        ->		EXCEPTION (null)
+	4 getBinaryStream      ->		EXCEPTION (null)
+	4 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getBoolean           ->'false'    	: java.lang.Boolean
+	4 getByte              ->'0'    	: java.lang.Byte
+	4 getBytes             ->		EXCEPTION (null)
+	4 getCharacterStream   ->		EXCEPTION (null)
+	4 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'CHAR () FOR BIT DATA'.)
+	4 getDate              ->		EXCEPTION (null)
+	4 getDouble            ->'0.0'    	: java.lang.Double
+	4 getFloat             ->'0.0'    	: java.lang.Float
+	4 getInt               ->'0'    	: java.lang.Integer
+	4 getLong              ->'0'    	: java.lang.Long
+	4 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	4 getShort             ->'0'    	: java.lang.Short
+	4 getString            ->		EXCEPTION (null)
+	4 getTime              ->		EXCEPTION (null)
+	4 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype long varchar for bit data
+select col_5 from clob_table
+	5 getObject            ->		EXCEPTION (null)
+	5 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	5 getAsciiStream       ->		EXCEPTION (null)
+	5 getBigDecimal        ->		EXCEPTION (null)
+	5 getBinaryStream      ->		EXCEPTION (null)
+	5 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getBoolean           ->'false'    	: java.lang.Boolean
+	5 getByte              ->'0'    	: java.lang.Byte
+	5 getBytes             ->		EXCEPTION (null)
+	5 getCharacterStream   ->		EXCEPTION (null)
+	5 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'LONG VARCHAR FOR BIT DATA'.)
+	5 getDate              ->		EXCEPTION (null)
+	5 getDouble            ->'0.0'    	: java.lang.Double
+	5 getFloat             ->'0.0'    	: java.lang.Float
+	5 getInt               ->'0'    	: java.lang.Integer
+	5 getLong              ->'0'    	: java.lang.Long
+	5 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	5 getShort             ->'0'    	: java.lang.Short
+	5 getString            ->		EXCEPTION (null)
+	5 getTime              ->		EXCEPTION (null)
+	5 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype blob(80)
+select col_6 from clob_table
+	6 getObject            ->		EXCEPTION (null)
+	6 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	6 getAsciiStream       ->		EXCEPTION (null)
+	6 getBigDecimal        ->		EXCEPTION (null)
+	6 getBinaryStream      ->		EXCEPTION (null)
+	6 getBlob              ->		EXCEPTION (null)
+	6 getBoolean           ->'false'    	: java.lang.Boolean
+	6 getByte              ->'0'    	: java.lang.Byte
+	6 getBytes             ->		EXCEPTION (null)
+	6 getCharacterStream   ->		EXCEPTION (null)
+	6 getClob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'BLOB'.)
+	6 getDate              ->		EXCEPTION (null)
+	6 getDouble            ->'0.0'    	: java.lang.Double
+	6 getFloat             ->'0.0'    	: java.lang.Float
+	6 getInt               ->'0'    	: java.lang.Integer
+	6 getLong              ->'0'    	: java.lang.Long
+	6 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	6 getShort             ->'0'    	: java.lang.Short
+	6 getString            ->		EXCEPTION (null)
+	6 getTime              ->		EXCEPTION (null)
+	6 getTimeStamp         ->		EXCEPTION (null)
+=== Columntype clob (64  )
+select typecol from clob_table
+	7 getObject            ->		EXCEPTION (null)
+	7 getArray             ->		EXCEPTION (Feature not implemented: no details.)
+	7 getAsciiStream       ->		EXCEPTION (null)
+	7 getBigDecimal        ->		EXCEPTION (null)
+	7 getBinaryStream      ->		EXCEPTION (An attempt was made to get a data value of type 'java.io.InputStream' from a data value of type 'CLOB'.)
+	7 getBlob              ->		EXCEPTION (An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'CLOB'.)
+	7 getBoolean           ->'false'    	: java.lang.Boolean
+	7 getByte              ->'0'    	: java.lang.Byte
+	7 getBytes             ->		EXCEPTION (null)
+	7 getCharacterStream   ->		EXCEPTION (null)
+	7 getClob              ->		EXCEPTION (null)
+	7 getDate              ->		EXCEPTION (null)
+	7 getDouble            ->'0.0'    	: java.lang.Double
+	7 getFloat             ->'0.0'    	: java.lang.Float
+	7 getInt               ->'0'    	: java.lang.Integer
+	7 getLong              ->'0'    	: java.lang.Long
+	7 getRef               ->		EXCEPTION (Feature not implemented: no details.)
+	7 getShort             ->'0'    	: java.lang.Short
+	7 getString            ->		EXCEPTION (null)
+	7 getTime              ->		EXCEPTION (null)
+	7 getTimeStamp         ->		EXCEPTION (null)
+---< METADATA TESTS
+select col_0 from clob_table
+	---- 1
+	Column    : COL_0
+	Type      : 4
+	TypeName  : INTEGER
+	ClassName : java.lang.Integer
+	Label     : COL_0
+	DisplaySz : 11
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_1 from clob_table
+	---- 1
+	Column    : COL_1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : COL_1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = 'true      ' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_2 from clob_table
+	---- 1
+	Column    : COL_2
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_2
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_3 from clob_table
+	---- 1
+	Column    : COL_3
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : COL_3
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = 'true' : java.lang.String
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select col_4 from clob_table
+	---- 1
+	Column    : COL_4
+	Type      : -2
+	TypeName  : CHAR () FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_4
+	DisplaySz : 20
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+	OUT = NULL
+select col_5 from clob_table
+	---- 1
+	Column    : COL_5
+	Type      : -4
+	TypeName  : LONG VARCHAR FOR BIT DATA
+	ClassName : byte[]
+	Label     : COL_5
+	DisplaySz : 65400
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : byte[]
+	OUT = NULL
+select col_6 from clob_table
+	---- 1
+	Column    : COL_6
+	Type      : 2004
+	TypeName  : BLOB
+	ClassName : java.sql.Blob
+	Label     : COL_6
+	DisplaySz : 160
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: false
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Blob
+select typecol from clob_table
+	---- 1
+	Column    : TYPECOL
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : TYPECOL
+	DisplaySz : 64
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+---< columns CAST TO type: METADATA TESTS
+select cast( col_0 as clob(64  ) ) from clob_table
+	SQL Exception: Cannot convert types 'INTEGER' to 'CLOB'.
+select cast( col_1 as clob(64  ) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 64
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = Object : java.sql.Clob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_2 as clob(64  ) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 64
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = Object : java.sql.Clob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_3 as clob(64  ) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 64
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = Object : java.sql.Clob
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( col_4 as clob(64  ) ) from clob_table
+	SQL Exception: Cannot convert types 'CHAR () FOR BIT DATA' to 'CLOB'.
+select cast( col_5 as clob(64  ) ) from clob_table
+	SQL Exception: Cannot convert types 'LONG VARCHAR FOR BIT DATA' to 'CLOB'.
+select cast( col_6 as clob(64  ) ) from clob_table
+	SQL Exception: Cannot convert types 'BLOB' to 'CLOB'.
+select cast( typecol as clob(64  ) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 64
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+---< type CAST TO types: METADATA TESTS
+select cast( typecol as int ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'INTEGER'.
+select cast( typecol as char(10) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 1
+	TypeName  : CHAR
+	ClassName : java.lang.String
+	Label     : 1
+	DisplaySz : 10
+	Precision : 10
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( typecol as varchar(80) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 12
+	TypeName  : VARCHAR
+	ClassName : java.lang.String
+	Label     : 1
+	DisplaySz : 80
+	Precision : 80
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( typecol as long varchar ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : -1
+	TypeName  : LONG VARCHAR
+	ClassName : java.lang.String
+	Label     : 1
+	DisplaySz : 32700
+	Precision : 32700
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+select cast( typecol as char(10) for bit data ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'CHAR () FOR BIT DATA'.
+select cast( typecol as long varchar for bit data ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'LONG VARCHAR FOR BIT DATA'.
+select cast( typecol as blob(80) ) from clob_table
+	SQL Exception: Cannot convert types 'CLOB' to 'BLOB'.
+select cast( typecol as clob (64  ) ) from clob_table
+	---- 1
+	Column    : 1
+	Type      : 2005
+	TypeName  : CLOB
+	ClassName : java.sql.Clob
+	Label     : 1
+	DisplaySz : 64
+	Precision : 64
+	Scale     : 0
+	isCurrency: false
+	isCaseSens: true
+	isDefWrite: false
+	isWrite   : false
+	isSearchab: true
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+	OUT = NULL
+drop table clob_table
+---< BLOB Insertion Tests
+create table blobCheck (bl blob(80)) 
+insert into blobCheck (bl ) values ('string' )
+	SQL Exception: Columns of type 'BLOB' cannot hold values of type 'CHAR'. 
+insert into blobCheck (bl ) values (cast (X'0073007400720069006e0067' as blob(80)) )
+insert into blobCheck (bl ) values (X'48' )
+	SQL Exception: Columns of type 'BLOB' cannot hold values of type 'CHAR () FOR BIT DATA'. 
+insert into blobCheck (bl ) values (cast (X'C8' as blob(80)) )
+insert into blobCheck (bl ) values ( X'a78a' )
+	SQL Exception: Columns of type 'BLOB' cannot hold values of type 'CHAR () FOR BIT DATA'. 
+insert into blobCheck (bl ) values (cast (X'a78a' as blob(80)) )
+insert into blobCheck (bl ) values ('string' )
+	SQL Exception: Columns of type 'BLOB' cannot hold values of type 'CHAR'. 
+insert into blobCheck (bl ) values (cast (X'0073007400720069006e0067' as blob(80)) )
+insert into blobCheck (bl ) values (X'48' )
+	SQL Exception: Columns of type 'BLOB' cannot hold values of type 'CHAR () FOR BIT DATA'. 
+insert into blobCheck (bl ) values (cast (X'C8' as blob(80)) )
+insert into blobCheck (bl ) values ( X'a78a' )
+	SQL Exception: Columns of type 'BLOB' cannot hold values of type 'CHAR () FOR BIT DATA'. 
+insert into blobCheck (bl ) values (cast (X'a78a' as blob(80)) )

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/StmtCloseFunTest.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/StmtCloseFunTest.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/StmtCloseFunTest.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,9 @@
+Statement Close Fun Test starting 
+Statement test begin
+Statement test end
+Prepared Statement test begin
+Prepared Statement test end
+Callable Statement test begin
+The result is 3
+Callable Statement test end
+Statement Close Fun Test finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/URLCheck.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/URLCheck.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/URLCheck.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,20 @@
+ij> -- Use a valid attribute, but do not display message.
+connect 'jdbc:derby:wombat;dataEncryption=true';
+ij(CONNECTION1)> -- Find an unknown attribute.
+connect 'jdbc:derby:wombat;unknown=x';
+URL Attribute [unknown=x]
+   Attribute is unknown to Derby.
+ij(CONNECTION2)> -- Check for duplicate.
+connect 'jdbc:derby:wombat;dataEncryption=true;dataEncryption=false';
+URL Attribute [dataEncryption=true]
+   Attribute is a duplicate.
+URL Attribute [dataEncryption=false]
+   Attribute is a duplicate.
+ij(CONNECTION3)> -- Perform case check.
+connect 'jdbc:derby:wombat;dataencryption=true';
+URL Attribute [dataencryption=true]
+   Attribute is unknown to Derby.
+ij(CONNECTION4)> -- Check for true/false.
+connect 'jdbc:derby:wombat;dataEncryption=x';
+ERROR XJ05B: JDBC attribute 'dataEncryption' has an invalid value 'x', valid values are '{true|false}'.
+ij(CONNECTION4)> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/altertable.out	Tue Jan 11 11:53:57 2005
@@ -181,7 +181,7 @@
 ij> rollback;
 ij> create function countopens() returns varchar(128)
 language java parameter style java
-external name 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.countOpens';
+external name 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.countOpens';
 0 rows inserted/updated/deleted
 ij> commit;
 ij> -- do consistency check on scans, etc.
@@ -631,7 +631,7 @@
 ij> execute p1;
 0 rows inserted/updated/deleted
 ij> -- do consistency check on scans, etc.
--- values (org.apache.derbyTesting.functionTests.util.ConsistencyChecker::countOpens());
+-- values (org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker::countOpens());
 -- verify the consistency of the indexes on the system catalogs
 select tablename, SYSCS_UTIL.SYSCS_CHECK_TABLE('SYS', tablename)
 from sys.systables where tabletype = 'S' and tablename != 'SYSDUMMY1';

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,274 @@
+Test autoGeneratedJdbc30 starting
+Test 1 - request for generated keys resultset on a brand new statement with no sql executed on it yet
+We will get a resultset with no rows because it is a non-insert sql
+<NULL>
+Test2 - request for generated keys on a statement which does select from a table ie a non-insert sql
+We will get a resultset with no rows because it is a non-insert sql
+<NULL>
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+<NULL>
+Test 3 - insert multiple rows into a table with autogenerated key and request generated keys resultset
+ We will get a row with NULL value because this insert sql inserted more than one row and 
+ there was no prior one-row insert into a table with autogenerated key
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 4 - request for generated keys after doing an insert into a table with no auto generated keys
+ And there has been no one-row insert into a table with auto-generated keys yet.
+We should get a resultset with one row of NULL value from getGeneratedKeys
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 5a - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
+Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 5b - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
+Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 5c - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
+Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
+	 1
+	 -
+	{null}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{null}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{null}
+Test 6 - request for generated keys after doing a one-row insert into a table with auto generated keys
+We should get a resultset with one row of non-NULL value
+	 1
+	 -
+	{29}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{30}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{31}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 7 - Now try again inserting multiple rows into a table with autogenerated key and request generated keys resultset
+ This time we will get a row of non-NULL value because there has been a prior one-row insert into table with auto-generated key 
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 8 - create a new statement and request for generated keys on it after doing an insert into 
+ a table with no auto generated keys
+We should get a resultset with one row of non-NULL value
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 9 - request for generated keys on a statement which does a update 
+We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
+<NULL>
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+<NULL>
+Test 10 - request for generated keys on a statement which does a delete 
+We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
+<NULL>
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+<NULL>
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+<NULL>
+Test 11 - do a commit and request for generated keys on a statement which does insert into a table with 
+ no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
+expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 12 - do a rollback and request for generated keys on a statement which does insert into a table with 
+ no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
+had expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
+	 1
+	 -
+	{32}
+Now try the same test again but this time with Statement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.execute. It should behave the same
+	 1
+	 -
+	{32}
+Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
+	 1
+	 -
+	{32}
+Test 13 - try savepoint rollback and see what happens to auto generated keys resultset
+Inside the savepoint unit, issue a one-row insert into a table with auto generated keys
+We should get a resultset with one row of non-NULL value
+	 1
+	 -
+	{33}
+Now rollback the savepoint unit, and make sure that autogenerated keys resultset still holds on to 
+ value that got set inside the rolled back savepoint unit
+	 1
+	 -
+	{33}
+Test 14 - Look at metadata of a getGeneratedKeys resultset
+The resultset will have one column only
+Found 1 column in the resultset
+Type of the column is DECIMAL
+Precision of the column is 31
+Scale of the column is 0
+	 1
+	 -
+	{25}
+Test 15 - Can not see the auto generated keys if insert is with NO_GENERATED_KEYS
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test 16 - Can not see the auto generated keys if insert is done jdbc 2.0 way ie with no generated key feature
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test 17 - non-insert with NO_GENERATED_KEYS
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test 18 - non-insert is done jdbc 2.0 way ie with no generated key feature
+<NULL>
+<NULL>
+<NULL>
+<NULL>
+Test19 - fix the no auto generated key resultset generated for INSERT with generated keys if server-side methods are invoked
+Inside server-side method with no insert statement
+Back to client side looking for auto generated keys
+	 1
+	 -
+	{33}
+	 1
+	 -
+	{16}
+Test20 - bug 4837garbage collection of the generated key result sets was closing the activation.
+Test21 - insert select with columnIndexes[] array should fail
+Try passing array with Statement.execute
+PASS - expected exception - Feature not implemented
+Try passing array with Statement.executeUpdate
+PASS -- expected exception
+SQLSTATE(0A000): Feature not implemented: executeUpdate(String, int[]).
+Test21ps - insert select with columnIndexes[] array should fail
+Try passing array with Connection.prepareStatement
+PASS -- expected exception
+SQLSTATE(0A000): Feature not implemented: prepareStatement(String, int[]).
+Test22 - insert select with columnNames[] array should fail
+Try passing array with Statement.execute
+PASS -- expected exception
+SQLSTATE(0A000): Feature not implemented: execute(String, String[]).
+Try passing array with Statement.executeUpdate
+PASS -- expected exception
+SQLSTATE(0A000): Feature not implemented: executeUpdate(String, String[]).
+Test22ps - insert select with columnNames[] array should fail
+Try passing array with Connection.prepareStatement
+PASS -- expected exception
+SQLSTATE(0A000): Feature not implemented: prepareStatement(String, String[]).
+Test autoGeneratedJdbc30 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/backupRestore1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/backupRestore1.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/backupRestore1.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,9 @@
+Test backupRestore starting
+database shutdown properly
+testing rollforward recovery
+3
+database shutdown properly
+database shutdown properly
+database shutdown properly
+database shutdown properly
+Test backupRestore1 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/batchUpdate.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/batchUpdate.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/batchUpdate.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,44 @@
+Test batchUpdate starting
+Positive Statement: clear the batch and run the empty batch
+Positive Statement: testing 1 statement batch
+Positive Statement: testing 2 inserts and 1 update batch
+Positive Statement: 1000 statements batch
+Positive Statement: statement testing batch with autocommit true
+Positive Statement: add 3 statements, clear batch and execute batch
+Positive Statement: add 3 statements, clear batch, add 3 and execute batch
+Positive Statement: testing associated parameters
+Negative Statement: statement testing select as first stat in the batch
+Negative Statement: statement testing select as nth stat in the batch
+Negative Statement: statement testing select as last stat in the batch
+Negative Statement: statement testing execute in the middle of batch
+Negative Statement: statement testing executeQuery in the middle of batch
+Negative Statement: statement testing executeUpdate in the middle of batch
+Negative Statement: statement testing overflow error as first stat in the batch
+Negative Statement: statement testing overflow error as nth stat in the batch
+Negative Statement: statement testing overflow error as last stat in the batch
+Negative Statement: statement testing time out while getting the lock in the batch
+Positive Callable Statement: statement testing callable statement batch
+Negative Callable Statement: callable statement with output parameters in the batch
+Positive Prepared Stat: set no parameter values and run the batch
+Positive Prepared Stat: no settable parameters
+Positive Prepared Stat: set one set of parameter values and run the batch
+Positive Prepared Stat: set 3 set of parameter values and run the batch
+Positive Prepared Stat: set one set of parameter values to null and run the batch
+Positive Prepared Stat: 1000 parameter set batch
+Positive Prepared Stat: batch, rollback, batch and commit combinations
+Positive Prepared Stat: batch and commit combinations
+Positive Prepared Stat: batch, batch and rollback combinations
+Positive Prepared Stat: batch, batch and commit combinations
+Positive Prepared Stat: testing batch with autocommit true
+Positive Prepared Stat: add 3 statements, clear batch and execute batch
+Positive Prepared Stat: add 3 statements, clear batch, add 3 and execute batch
+Negative Prepared Stat: testing select in the batch
+Negative Prepared Stat: testing execute in the middle of batch
+Negative Prepared Stat: testing executeQuery in the middle of batch
+Negative Prepared Stat: testing executeUpdate in the middle of batch
+Negative Prepared Stat: testing overflow as first set of values
+Negative Prepared Stat: testing overflow as nth set of values
+Negative Prepared Stat: testing overflow as last set of values
+Negative Prepared Stat: testing transaction error, time out while getting the lock
+PASS
+Test batchUpdate finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bestrowidentifier.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bestrowidentifier.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bestrowidentifier.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,176 @@
+ij> --
+-- test java.sql.Connection.DatabaseMetaData.getBestRowIdentifier()
+--
+-- create a java procedure to do the metadata call
+create procedure getBestRowID(in schema_param Char(10), in tableName_param Char(10), in scope_param int, in nullable_param Char(5)) parameter style java reads sql data dynamic result sets 1 language java external name 'org.apache.derbyTesting.functionTests.util.metadataHelperProcs.getBestRowId';
+0 rows inserted/updated/deleted
+ij> prepare bestrow as 'call getBestRowID(?,?,?,?)';
+ij> autocommit off;
+ij> -- each one of these have only one choice
+create table t1 (i int not null primary key, j int);
+0 rows inserted/updated/deleted
+ij> create table t2 (i int not null unique, j int);
+0 rows inserted/updated/deleted
+ij> -- adding not null unique to j - otherwise t2 & t3 would be same.
+create table t3 (i int not null unique, j int not null unique);
+0 rows inserted/updated/deleted
+ij> create table t4 (i int, j int);
+0 rows inserted/updated/deleted
+ij> create unique index t4i on t4(i);
+0 rows inserted/updated/deleted
+ij> create table t5 (i int, j int);
+0 rows inserted/updated/deleted
+ij> -- result: column i
+execute bestrow using 'values(''APP'',''T1'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- result: column i
+execute bestrow using 'values(''APP'',''T2'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- result: column i
+execute bestrow using 'values(''APP'',''T3'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- result: column i
+execute bestrow using 'values(''APP'',''T4'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- result: columns i and j
+execute bestrow using 'values(''APP'',''T5'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> rollback work;
+ij> -- PK preferred to unique
+create table t6 (i int not null unique, j int not null primary key);
+0 rows inserted/updated/deleted
+ij> -- result: column j
+execute bestrow using 'values(''APP'',''T6'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- PK preferred to unique index
+create table t7 (i int not null, j int not null primary key);
+0 rows inserted/updated/deleted
+ij> create unique index t7i_index on t7(i);
+0 rows inserted/updated/deleted
+ij> -- result: column j
+execute bestrow using 'values(''APP'',''T7'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- unique con preferred to unique index
+create table t8 (i int not null, j int not null unique);
+0 rows inserted/updated/deleted
+ij> create unique index t8i_index on t8(i);
+0 rows inserted/updated/deleted
+ij> -- result: column j
+execute bestrow using 'values(''APP'',''T8'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- non-unique index just ignored
+create table t9 (i int, j int);
+0 rows inserted/updated/deleted
+ij> create index t9i_index on t9(i);
+0 rows inserted/updated/deleted
+ij> -- result: columns i,j
+execute bestrow using 'values(''APP'',''T9'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> rollback work;
+ij> -- fewer cols unique con still ignored over primary key
+create table t10 (i int unique not null , j int not null , primary key (i,j));
+0 rows inserted/updated/deleted
+ij> -- result: columns i,j
+execute bestrow using 'values(''APP'',''T10'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- fewer cols unique index still ignored over primary key
+create table t11 (i int not null, j int not null, primary key (i,j));
+0 rows inserted/updated/deleted
+ij> create unique index t11i_index on t11(i);
+0 rows inserted/updated/deleted
+ij> -- result: columns i,j
+execute bestrow using 'values(''APP'',''T11'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- fewer cols unique index still ignored over unique con
+create table t12 (i int not null, j int not null, unique (i,j));
+0 rows inserted/updated/deleted
+ij> create unique index t12i_index on t12(i);
+0 rows inserted/updated/deleted
+ij> -- result: columns i,j
+execute bestrow using 'values(''APP'',''T12'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> rollback work;
+ij> -- REMIND: we aren't handling nullOk flag correctly
+-- we just drop nullable cols, we should skip an answer
+-- that has nullable cols in it instead and look for another one.
+create table t13 (i int not null, j int not null, k int, unique (i,j));
+0 rows inserted/updated/deleted
+ij> -- result: columns i, j (WRONG) 
+-- the correct answer is k: the non-null columns of the table
+execute bestrow using 'values(''APP'',''T13'',0,''false'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+2     |J                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- fewest cols unique con is the one picked of several
+create table t14 (i int not null unique, j int not null, k int, unique (i,j));
+0 rows inserted/updated/deleted
+ij> -- result: columns i
+execute bestrow using 'values(''APP'',''T14'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- fewest cols unique index is the one picked of several
+create table t15 (i int not null, j int not null, k int);
+0 rows inserted/updated/deleted
+ij> create unique index t15ij on t15(i,j);
+0 rows inserted/updated/deleted
+ij> create unique index t15i on t15(i);
+0 rows inserted/updated/deleted
+ij> -- result: columns i
+execute bestrow using 'values(''APP'',''T15'',0,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- we don't do anything with SCOPE except detect bad values
+create table t16 (i int not null primary key, j int);
+0 rows inserted/updated/deleted
+ij> -- result: columns i
+execute bestrow using 'values(''APP'',''T16'',1,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- result: columns i
+execute bestrow using 'values(''APP'',''T16'',2,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+2     |I                                                                                                                               |4     |INTEGER                                                                                                                         |4          |NULL       |10    |1     
+ij> -- result: no rows
+execute bestrow using 'values(''APP'',''T16'',-1,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> -- result: no rows
+execute bestrow using 'values(''APP'',''T16'',3,''true'')';
+SCOPE |COLUMN_NAME                                                                                                                     |DATA_&|TYPE_NAME                                                                                                                       |COLUMN_SIZE|BUFFER_LEN&|DECIM&|PSEUD&
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> rollback work;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,788 @@
+Test blobclob starting
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+unicode string 0 correct
+unicode string 1 correct
+unicode string 2 correct
+Finished prepareUnicodeFile
+Length of clob is 5009
+unicode string 0 matched
+unicode string 1 matched
+unicode string 2 matched
+EOF matched
+setCharacterStreamTest finished
+clobTest0 finished
+clobTest11 finished
+Succeeded to match, row 1
+PASSED, row 1, length was 3
+Succeeded to match, row 2
+PASSED, row 2, length was 3
+Succeeded to match, row 3
+PASSED, row 3, length was 3
+Succeeded to match, row 4
+PASSED, row 4, length was 5016
+Succeeded to match, row 5
+PASSED, row 5, length was 5016
+Succeeded to match, row 6
+PASSED, row 6, length was 5016
+clobTest12 finished
+CLOB getSubString 9905 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 204 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+CLOB getSubString 68 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+CLOB getSubString 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+CLOB getSubString 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+CLOB getSubString 9905 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 204 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+CLOB getSubString 68 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+2(5) (len 50) you can lead a horse to water but you can't form i
+2(6) (len 1) y
+CLOB getSubString 9905 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 204 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+CLOB getSubString 68 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+3(5) (len 50) a stitch in time says ouch
+3(6) (len 1) a
+CLOB getSubString 9905 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 204 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+CLOB getSubString 68 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+4(5) (len 50) here is a string with a return 
+ character
+4(6) (len 1) h
+CLOB getSubString 9905 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 204 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+CLOB getSubString 68 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+5(5) (len 50) test data: a string column inserted as an Ascii st
+5(6) (len 1) t
+6(0) (len 50) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
+6(1) (len 150) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(2) (len 50) I-am-hiding-here-at-position-5910-in-this-little-c
+6(3) (len 50) This-is-position-204wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(4) (len 50) wposition-69-end-of-the-first-l
+ine-we-are-now-on
+6(5) (len 50) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(6) (len 1) B
+6(7) 
+wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+CLOB getSubString 9905 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 204 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+CLOB getSubString 68 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+CLOB getSubString 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+CLOB getSubString 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+CLOB getSubString 9905 > 5000
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 5000
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+CLOB getSubString 5910 > 5000
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+8(3) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(4) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+8(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(6) (len 1) w
+8(7) 
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(0) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(1) (len 150) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(2) (len 50) I-am-hiding-here-at-position-5910-in-this-humungus
+9(3) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(4) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+9(5) (len 50) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(6) (len 1) w
+9(7) 
+wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+clobTest2 finished
+Row 1 : Succeeded
+Row 2 : Succeeded
+Row 3 : Succeeded
+Row 4 : Succeeded
+Second time Succeeded
+Row 5 : Succeeded
+Second time Succeeded
+Row 6 : Succeeded
+Second time Succeeded
+clobTest22 finished
+Found horse in row 1 starting from position 1 at position  NOTFOUND 
+Found ouch in row 1 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 1 starting from position 1 at position  NOTFOUND 
+Found  in row 1 starting from position 1 at position 1
+Found Beginning in row 1 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 1 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 1 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 1 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 1 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 1 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 1 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 1 starting from position 1 at position  NOTFOUND 
+Found horse in row 2 starting from position 1 at position 16
+Found ouch in row 2 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 2 starting from position 1 at position  NOTFOUND 
+Found  in row 2 starting from position 1 at position 1
+Found Beginning in row 2 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 2 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 2 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 2 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 2 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 2 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 2 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 2 starting from position 1 at position  NOTFOUND 
+Found horse in row 3 starting from position 1 at position  NOTFOUND 
+Found ouch in row 3 starting from position 1 at position 23
+Found 
+ in row 3 starting from position 1 at position  NOTFOUND 
+Found  in row 3 starting from position 1 at position 1
+Found Beginning in row 3 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 3 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 3 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 3 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 3 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 3 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 3 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 3 starting from position 1 at position  NOTFOUND 
+Found horse in row 4 starting from position 1 at position  NOTFOUND 
+Found ouch in row 4 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 4 starting from position 1 at position 32
+Found  in row 4 starting from position 1 at position 1
+Found Beginning in row 4 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 4 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 4 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 4 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 4 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 4 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 4 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 4 starting from position 1 at position  NOTFOUND 
+Found horse in row 5 starting from position 1 at position  NOTFOUND 
+Found ouch in row 5 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 5 starting from position 1 at position 56
+Found  in row 5 starting from position 1 at position 1
+Found Beginning in row 5 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 5 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 5 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 5 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 5 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 5 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 5 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 5 starting from position 1 at position  NOTFOUND 
+Found horse in row 6 starting from position 1 at position  NOTFOUND 
+Found ouch in row 6 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 6 starting from position 1 at position 100
+Found  in row 6 starting from position 1 at position 1
+Found Beginning in row 6 starting from position 1 at position 1
+Found Beginning in row 6 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 6 starting from position 1 at position 69
+Found This-is-position-204 in row 6 starting from position 1 at position 204
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 1 at position 5910
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 5910 at position 5910
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 6 starting from position 1 at position 9907
+Found horse in row 7 starting from position 1 at position  NOTFOUND 
+Found ouch in row 7 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 7 starting from position 1 at position  NOTFOUND 
+Found  in row 7 starting from position 1 at position 1
+Found Beginning in row 7 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 7 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 7 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 7 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 7 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 7 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 7 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 7 starting from position 1 at position  NOTFOUND 
+Found horse in row 8 starting from position 1 at position  NOTFOUND 
+Found ouch in row 8 starting from position 1 at position  NOTFOUND 
+Found 
+ in row 8 starting from position 1 at position 100
+Found  in row 8 starting from position 1 at position 1
+Found Beginning in row 8 starting from position 1 at position  NOTFOUND 
+Found Beginning in row 8 starting from position 2 at position  NOTFOUND 
+Found position-69 in row 8 starting from position 1 at position  NOTFOUND 
+Found This-is-position-204 in row 8 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 8 starting from position 1 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 8 starting from position 5910 at position  NOTFOUND 
+Found I-am-hiding-here-at-position-5910 in row 8 starting from position 5911 at position  NOTFOUND 
+Found Position-9907 in row 8 starting from position 1 at position  NOTFOUND 
+clobTest3 finished
+Succeeded: Found unicode string 0 at position 1,row 1
+Succeeded: Found unicode string 0 at position -1,row 1
+Succeeded: Found unicode string 1 at position 1,row 2
+Succeeded: Found unicode string 1 at position -1,row 2
+Succeeded: Found unicode string 2 at position 1,row 3
+Succeeded: Found unicode string 2 at position -1,row 3
+Succeeded: Found unicode string 0 at position 1,row 4
+Succeeded: Found unicode string 0 at position 5004,row 4
+Succeeded: Found unicode string 1 at position 1,row 5
+Succeeded: Found unicode string 1 at position 5004,row 5
+Succeeded: Found unicode string 2 at position 1,row 6
+Succeeded: Found unicode string 2 at position 5004,row 6
+clobTest32 finished
+position(clob) NOT FOUND 1 searchStr horse
+position(clob) NOT FOUND 1 searchStr ouch
+position(clob) NOT FOUND 1 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 1 searchStr Beginning
+position(clob) NOT FOUND 1 searchStr position-69
+position(clob) NOT FOUND 1 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 1 searchStr Position-9907
+position(clob) NOT FOUND 1 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 1 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 1 searchStr >150chars
+searchClob row 13 skipped (too large)
+Found horse in row 2 at position 16
+position(clob) NOT FOUND 2 searchStr ouch
+position(clob) NOT FOUND 2 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 65
+position(clob) NOT FOUND 2 searchStr Beginning
+position(clob) NOT FOUND 2 searchStr position-69
+position(clob) NOT FOUND 2 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 2 searchStr Position-9907
+position(clob) NOT FOUND 2 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 2 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 65
+position(clob) NOT FOUND 2 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 3 searchStr horse
+Found ouch in row 3 at position 23
+position(clob) NOT FOUND 3 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 26
+position(clob) NOT FOUND 3 searchStr Beginning
+position(clob) NOT FOUND 3 searchStr position-69
+position(clob) NOT FOUND 3 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 3 searchStr Position-9907
+position(clob) NOT FOUND 3 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 3 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 26
+position(clob) NOT FOUND 3 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 4 searchStr horse
+position(clob) NOT FOUND 4 searchStr ouch
+Found 
+ in row 4 at position 32
+position(clob) FOUND @ 1 with empty search clob in clob of length 42
+position(clob) NOT FOUND 4 searchStr Beginning
+position(clob) NOT FOUND 4 searchStr position-69
+position(clob) NOT FOUND 4 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 4 searchStr Position-9907
+position(clob) NOT FOUND 4 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 4 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 42
+position(clob) NOT FOUND 4 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 5 searchStr horse
+position(clob) NOT FOUND 5 searchStr ouch
+Found 
+ in row 5 at position 56
+position(clob) FOUND @ 1 with empty search clob in clob of length 56
+position(clob) NOT FOUND 5 searchStr Beginning
+position(clob) NOT FOUND 5 searchStr position-69
+position(clob) NOT FOUND 5 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 5 searchStr Position-9907
+Found test data: a string column inserted as an Ascii stream
+ in row 5 at position 1
+position(clob) NOT FOUND 5 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 56
+position(clob) NOT FOUND 5 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 6 searchStr horse
+position(clob) NOT FOUND 6 searchStr ouch
+Found 
+ in row 6 at position 100
+position(clob) FOUND @ 1 with empty search clob in clob of length 10000
+Found Beginning in row 6 at position 1
+Found position-69 in row 6 at position 69
+Found I-am-hiding-here-at-position-5910 in row 6 at position 5910
+Found Position-9907 in row 6 at position 9907
+position(clob) NOT FOUND 6 searchStr test data: a string column inserted as an Ascii stream
+Found clob (row 10)  in row 6 at position 1
+position(clob) FOUND @ 1 with empty search clob in clob of length 10000
+Found clob (row 12)  in row 6 at position 301
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 7 searchStr horse
+position(clob) NOT FOUND 7 searchStr ouch
+position(clob) NOT FOUND 7 searchStr 
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 7 searchStr Beginning
+position(clob) NOT FOUND 7 searchStr position-69
+position(clob) NOT FOUND 7 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 7 searchStr Position-9907
+position(clob) NOT FOUND 7 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 7 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 0
+position(clob) NOT FOUND 7 searchStr >150chars
+searchClob row 13 skipped (too large)
+position(clob) NOT FOUND 8 searchStr horse
+position(clob) NOT FOUND 8 searchStr ouch
+Found 
+ in row 8 at position 100
+position(clob) FOUND @ 1 with empty search clob in clob of length 5000
+position(clob) NOT FOUND 8 searchStr Beginning
+position(clob) NOT FOUND 8 searchStr position-69
+position(clob) NOT FOUND 8 searchStr I-am-hiding-here-at-position-5910
+position(clob) NOT FOUND 8 searchStr Position-9907
+position(clob) NOT FOUND 8 searchStr test data: a string column inserted as an Ascii stream
+position(clob) NOT FOUND 8 searchStr >150chars
+position(clob) FOUND @ 1 with empty search clob in clob of length 5000
+Found clob (row 12)  in row 8 at position 1
+searchClob row 13 skipped (too large)
+testCLOB_MAIN row 9 skipped (too large)
+clobTest4 finished
+Succeeded: Found clob at position 1,row 0
+Succeeded: Found clob at position 1,row 1
+Succeeded: Found clob at position 1,row 2
+clobTest42 finished
+clobTest51 finished
+create table testInteger (a integer)
+insert into testInteger values('158')
+select a from testInteger
+getClob(1)
+52: SQLException
+FAIL -- unexpected exception ****************
+SQLSTATE(22005): An attempt was made to get a data value of type 'java.sql.Clob' from a data value of type 'INTEGER'.
+clobTest53 finished
+start clobTest54
+EXPECTED SQLSTATE(22005): An attempt was made to get a data value of type 'INTEGER' from a data value of type 'java.sql.Clob'.
+end clobTest54
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ071): Zero or negative length argument '-76' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ071): Zero or negative length argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-4,000' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a Blob or Clob position method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-42' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a Blob or Clob position method.
+clobTest6 finished
+start clobTest7
+clobTest7 finished
+start clobTest8
+small string pattern
+@1  position MATCH(129)
+@2  position MATCH(2074)
+@3  position MATCH(4595)
+@4  position MATCH(34584)
+@5  position MATCH(67918)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+small java.sql.Clob pattern
+@1  position MATCH(129)
+@2  position MATCH(2074)
+@3  position MATCH(4595)
+@4  position MATCH(34584)
+@5  position MATCH(67918)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+medium string pattern
+@1  position MATCH(11253)
+@2  position MATCH(12225)
+@3  position MATCH(13478)
+@4  position MATCH(43467)
+@5  position MATCH(76801)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+medium java.sql.Clob pattern
+@1  position MATCH(11253)
+@2  position MATCH(12225)
+@3  position MATCH(13478)
+@4  position MATCH(43467)
+@5  position MATCH(76801)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+long string pattern
+@1  position MATCH(287875)
+@2  position MATCH(288847)
+@3  position MATCH(290108)
+@4  position MATCH(305102)
+@5  position MATCH(321769)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+long java.sql.Clob pattern
+@1  position MATCH(287875)
+@2  position MATCH(288847)
+@3  position MATCH(290108)
+@4  position MATCH(305102)
+@5  position MATCH(321769)
+@6  position MATCH(-1)
+@7  position MATCH(-1)
+@8  position MATCH(-1)
+@9  position MATCH(-1)
+@10  position MATCH(-1)
+complete clobTest8
+done row 0, length was 0
+done row 1, length was 65
+done row 2, length was 26
+done row 3, length was 42
+done row 4, length was 56
+done row 5, length was 10000
+done row 6, length was 0
+done row 7, length was 5000
+done row 8, length was 300000
+row 9 is null, skipped
+clobTest91 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(40XL1): A lock could not be obtained within the time requested
+clobTest92 finished
+shortClob length after commit is 26
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+clobTest94 finished
+shortClob length after closing connection is 26
+FAIL -- unexpected exception ****************
+SQLSTATE(08003): No current connection.
+FAIL -- unexpected exception ****************
+SQLSTATE(08003): No current connection.
+FAIL -- unexpected exception ****************
+SQLSTATE(08003): No current connection.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(08003): No current connection.
+clobTest95 finished
+clobTest96 finished
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+===> inserting extin/short.txt length = 56
+===> inserting extin/littleclob.txt length = 10000
+===> inserting extin/empty.txt length = 0
+===> inserting extin/searchclob.txt length = 5000
+===> inserting extin/aclob.txt length = 300000
+blobTest0 finished
+testing Blob.getBytes() with pos 9905 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 204 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 68 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 9905 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 204 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 68 > 65
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+2(5) you can lead a horse to water but you can't form i
+2(6) y
+testing Blob.getBytes() with pos 9905 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 204 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 68 > 26
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+3(5) a stitch in time says ouch
+3(6) a
+testing Blob.getBytes() with pos 9905 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 204 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 68 > 42
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+4(5) here is a string with a return 
+ character
+4(6) h
+testing Blob.getBytes() with pos 9905 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 204 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 68 > 56
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+5(5) test data: a string column inserted as an Ascii st
+5(6) t
+6(0) wwPosition-9907-behold-the-end-of-the-clob-is-nigh
+6(1) I-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(2) I-am-hiding-here-at-position-5910-in-this-little-c
+6(3) This-is-position-204wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(4) wposition-69-end-of-the-first-l
+ine-we-are-now-on
+6(5) Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+6(6) B
+6(7) 
+wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+testing Blob.getBytes() with pos 9905 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 204 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '204' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 68 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '68' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 1 > 0
+EXPECTED SQLSTATE(XJ076): The position argument '1' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 9905 > 5000
+EXPECTED SQLSTATE(XJ076): The position argument '9,905' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 5000
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+testing Blob.getBytes() with pos 5910 > 5000
+EXPECTED SQLSTATE(XJ076): The position argument '5,910' exceeds the size of the Blob/Clob.
+8(3) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(4) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+8(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+8(6) w
+8(7) 
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(0) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(1) I-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(2) I-am-hiding-here-at-position-5910-in-this-humungus
+9(3) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(4) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwww
+9(5) wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+9(6) w
+9(7) 
+wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+blobTest2 finished
+Found horse in row 2 starting from position 1 at position 16
+Found ouch in row 3 starting from position 1 at position 23
+Found 
+ in row 4 starting from position 1 at position 32
+Found 
+ in row 5 starting from position 1 at position 56
+Found 
+ in row 6 starting from position 1 at position 100
+Found Beginning in row 6 starting from position 1 at position 1
+Found position-69 in row 6 starting from position 1 at position 69
+Found This-is-position-204 in row 6 starting from position 1 at position 204
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 1 at position 5910
+Found I-am-hiding-here-at-position-5910 in row 6 starting from position 5910 at position 5910
+Found Position-9907 in row 6 starting from position 1 at position 9907
+Found 
+ in row 8 starting from position 1 at position 100
+blobTest3 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+searchBlob row 13 skipped (too large)
+Found horse in row 2 at position 16
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+searchBlob row 13 skipped (too large)
+Found ouch in row 3 at position 23
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+searchBlob row 13 skipped (too large)
+Found 
+ in row 4 at position 32
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+searchBlob row 13 skipped (too large)
+Found 
+ in row 5 at position 56
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+Found test data: a string column inserted as an Ascii stream
+ in row 5 at position 1
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+searchBlob row 13 skipped (too large)
+Found 
+ in row 6 at position 100
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+Found Beginning in row 6 at position 1
+Found position-69 in row 6 at position 69
+Found I-am-hiding-here-at-position-5910 in row 6 at position 5910
+Found Position-9907 in row 6 at position 9907
+Found blob (row 10)  in row 6 at position 1
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+Found blob (row 12)  in row 6 at position 301
+searchBlob row 13 skipped (too large)
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+searchBlob row 13 skipped (too large)
+Found 
+ in row 8 at position 100
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ077): Got an exception when trying to read the first byte/character of the Blob/Clob pattern using getBytes/getSubString.
+Found blob (row 12)  in row 8 at position 1
+searchBlob row 13 skipped (too large)
+testBlob row 9 skipped (too large)
+blobTest4 finished
+blobTest51 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(22005): An attempt was made to get a data value of type 'java.sql.Blob' from a data value of type 'INTEGER'.
+blobTest53 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(22005): An attempt was made to get a data value of type 'INTEGER' from a data value of type 'java.sql.Blob'.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ071): Zero or negative length argument '-76' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ071): Zero or negative length argument '0' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-4,000' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a Blob or Clob position method.
+EXPECTED SQLSTATE(XJ070): Negative or zero position argument '-42' passed in a Blob or Clob method.
+EXPECTED SQLSTATE(XJ072): Null pattern or searchStr passed in to a Blob or Clob position method.
+blobTest6 finished
+blobTest7 finished
+done row 0, length was 0
+done row 1, length was 65
+done row 2, length was 26
+done row 3, length was 42
+done row 4, length was 56
+done row 5, length was 10000
+done row 6, length was 0
+done row 7, length was 5000
+done row 8, length was 300000
+row 9 is null, skipped
+blobTest91 finished
+FAIL -- unexpected exception ****************
+SQLSTATE(40XL1): A lock could not be obtained within the time requested
+blobTest93 finished
+shortBlob length after commit is 26
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+blobTest94 finished
+shortBlob length after closing the connection is 26
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+FAIL -- unexpected exception ****************
+SQLSTATE(XJ073): The data in this Blob or Clob is no longer available. Possible reasons are that its transaction committed, or its connection closed.
+blobTest95 finished
+blobTest96 finished
+length of clob chosen is 10000
+After update
+Row 1 value.substring(0,50) is jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+10000 total bytes read
+clobTestSelfDestructive finished
+length of clob chosen is 10000
+After drop
+Expect to get an IOException, container has been closed
+EXPECTED IO Exception:ERROR 40XD0: Container has been closed
+FINISHED TEST blobclob :-)
+Test blobclob finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bootLock.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bootLock.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bootLock.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,5 @@
+Test BootLock Starting
+expected exception
+SQLSTATE(XJ040): 
+SQLSTATE(XSDB6): 
+Test BootLock finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/characterStreams.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,161 @@
+Test characterStreams starting
+Test setAsciiStream into CHAR
+CORRECT NUMBER OF BYTES IN STREAM
+MORE BYTES IN STREAM THAN PASSED IN VALUE
+MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+LESS BYTES IN STREAM THAN PASSED IN VALUE
+LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+NULL ASCII STREAM
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+1          |Lieberman ran with Gore  |23         |NULL                     |NULL       |NULL                     |NULL       
+4          |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Results from ASCII stream
+1,Lieberman ran with Gore  ,<NULL>,<NULL>
+4,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read char) stream
+1,Lieberman ran with Gore  ,<NULL>,<NULL>
+4,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read block) stream
+1,Lieberman ran with Gore  ,<NULL>,<NULL>
+4,<NULL>,<NULL>,<NULL>
+Test setAsciiStream into VARCHAR
+CORRECT NUMBER OF BYTES IN STREAM
+MORE BYTES IN STREAM THAN PASSED IN VALUE
+MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+LESS BYTES IN STREAM THAN PASSED IN VALUE
+LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+NULL ASCII STREAM
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+5          |NULL                     |NULL       |Lieberman ran with Gore  |23         |NULL                     |NULL       
+8          |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Results from ASCII stream
+5,<NULL>,Lieberman ran with Gore,<NULL>
+8,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read char) stream
+5,<NULL>,Lieberman ran with Gore,<NULL>
+8,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read block) stream
+5,<NULL>,Lieberman ran with Gore,<NULL>
+8,<NULL>,<NULL>,<NULL>
+Test setAsciiStream into LONG VARCHAR
+CORRECT NUMBER OF BYTES IN STREAM
+MORE BYTES IN STREAM THAN PASSED IN VALUE
+MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+LESS BYTES IN STREAM THAN PASSED IN VALUE
+LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+NULL ASCII STREAM
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+9          |NULL                     |NULL       |NULL                     |NULL       |Lieberman ran with Gore  |23         
+12         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Results from ASCII stream
+9,<NULL>,<NULL>,Lieberman ran with Gore
+12,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read char) stream
+9,<NULL>,<NULL>,Lieberman ran with Gore
+12,<NULL>,<NULL>,<NULL>
+Results from Character Stream (read block) stream
+9,<NULL>,<NULL>,Lieberman ran with Gore
+12,<NULL>,<NULL>,<NULL>
+Test setCharacterStream into CHAR
+MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+13         |A Mississippi Republican |24         |NULL                     |NULL       |NULL                     |NULL       
+14         |Lott has apologized      |19         |NULL                     |NULL       |NULL                     |NULL       
+17         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Test setCharacterStream into VARCHAR
+MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+18         |NULL                     |NULL       |A Mississippi Republican |24         |NULL                     |NULL       
+19         |NULL                     |NULL       |Lott has apologized      |19         |NULL                     |NULL       
+22         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+Test setCharacterStream into LONG VARCHAR
+MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED SQL Exception: An IOException was thrown when reading a 'java.sql.String' from an InputStream.
+ID         |C                        |CLEN       |VC                       |VCLEN      |LVC                      |LVCLEN     
+-----------------------------------------------------------------------------------------------------------------------------
+23         |NULL                     |NULL       |NULL                     |NULL       |A Mississippi Republican |24         
+24         |NULL                     |NULL       |NULL                     |NULL       |Lott has apologized      |19         
+27         |NULL                     |NULL       |NULL                     |NULL       |NULL                     |NULL       
+setAsciiStream(LONG ASCII STREAMS)
+AS-CHAR-18 DONE
+AS-VARCHAR-104 DONE
+AS-LONG VARCHAR-67 DONE
+CS-CHAR-18 DONE
+CS-VARCHAR-104 DONE
+CS-LONG VARCHAR-67 DONE
+ST-CHAR-18 DONE
+ST-VARCHAR-104 DONE
+ST-LONG VARCHAR-67 DONE
+AS-CHAR-25 DONE
+AS-VARCHAR-16732 DONE
+AS-LONG VARCHAR-14563 DONE
+CS-CHAR-25 DONE
+CS-VARCHAR-16732 DONE
+CS-LONG VARCHAR-14563 DONE
+ST-CHAR-25 DONE
+ST-VARCHAR-16732 DONE
+ST-LONG VARCHAR-14563 DONE
+AS-CHAR-1 DONE
+AS-VARCHAR-32433 DONE
+AS-LONG VARCHAR-32673 DONE
+CS-CHAR-1 DONE
+CS-VARCHAR-32433 DONE
+CS-LONG VARCHAR-32673 DONE
+ST-CHAR-1 DONE
+ST-VARCHAR-32433 DONE
+ST-LONG VARCHAR-32673 DONE
+AS-CHAR-0 DONE
+AS-VARCHAR-32532 DONE
+AS-LONG VARCHAR-32700 DONE
+CS-CHAR-0 DONE
+CS-VARCHAR-32532 DONE
+CS-LONG VARCHAR-32700 DONE
+ST-CHAR-0 DONE
+ST-VARCHAR-32532 DONE
+ST-LONG VARCHAR-32700 DONE
+setCharacterStream(LONG CHARACTER STREAMS WITH UNICODE)
+AS-CHAR-14 DONE
+AS-VARCHAR-93 DONE
+AS-LONG VARCHAR-55 DONE
+CS-CHAR-14 DONE
+CS-VARCHAR-93 DONE
+CS-LONG VARCHAR-55 DONE
+ST-CHAR-14 DONE
+ST-VARCHAR-93 DONE
+ST-LONG VARCHAR-55 DONE
+AS-CHAR-25 DONE
+AS-VARCHAR-19332 DONE
+AS-LONG VARCHAR-18733 DONE
+CS-CHAR-25 DONE
+CS-VARCHAR-19332 DONE
+CS-LONG VARCHAR-18733 DONE
+ST-CHAR-25 DONE
+ST-VARCHAR-19332 DONE
+ST-LONG VARCHAR-18733 DONE
+AS-CHAR-1 DONE
+AS-VARCHAR-32433 DONE
+AS-LONG VARCHAR-32673 DONE
+CS-CHAR-1 DONE
+CS-VARCHAR-32433 DONE
+CS-LONG VARCHAR-32673 DONE
+ST-CHAR-1 DONE
+ST-VARCHAR-32433 DONE
+ST-LONG VARCHAR-32673 DONE
+AS-CHAR-0 DONE
+AS-VARCHAR-32532 DONE
+AS-LONG VARCHAR-32700 DONE
+CS-CHAR-0 DONE
+CS-VARCHAR-32532 DONE
+CS-LONG VARCHAR-32700 DONE
+ST-CHAR-0 DONE
+ST-VARCHAR-32532 DONE
+ST-LONG VARCHAR-32700 DONE
+PASS
+Test characterStreams finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,572 @@
+Running connection checks on Nested
+  isolation level 2
+  auto commit     false
+  read only       false
+Running connection checks on DriverManager 
+  isolation level 2
+  auto commit     true
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+DriverManager  <closedconn>.close() no error
+DriverManager  <closedconn>.createStatement() 08003 - No current connection.
+DriverManager  <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+EmbeddedDataSource <closedconn>.close() no error
+EmbeddedDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(1):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(1):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Changes rolled back OK in auto closed pooled connection
+EVENT(1):connectionClosed
+expected SQL Exception: No current connection.
+expected SQL Exception: No current connection.
+Running connection checks on EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(3):connectionClosed
+method calls on a closed connection
+EmbeddedXADataSource <closedconn>.close() no error
+EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Changes rolled back OK in auto closed local XAConnection
+EVENT(3):connectionClosed
+ERROR XJ015: Derby system shutdown.
+Running connection checks on Nested
+  isolation level 2
+  auto commit     false
+  read only       false
+Running connection checks on DriverManager 
+  isolation level 2
+  auto commit     true
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+DriverManager  <closedconn>.close() no error
+DriverManager  <closedconn>.createStatement() 08003 - No current connection.
+DriverManager  <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+EmbeddedDataSource <closedconn>.close() no error
+EmbeddedDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(2):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(2):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(4):connectionClosed
+method calls on a closed connection
+EmbeddedXADataSource <closedconn>.close() no error
+EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(4):connectionClosed
+method calls on a closed connection
+EmbeddedXADataSource <closedconn>.close() no error
+EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+EVENT(5):connectionClosed
+Running connection checks on Global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Global EmbeddedXADataSource <closedconn>.close() no error
+Global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on Global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Global EmbeddedXADataSource <closedconn>.close() no error
+Global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on Switch to local EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to local EmbeddedXADataSource <closedconn>.close() no error
+Switch to local EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to local EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on Switch to local EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to local EmbeddedXADataSource <closedconn>.close() no error
+Switch to local EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to local EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on Switch to global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to global EmbeddedXADataSource <closedconn>.close() no error
+Switch to global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running connection checks on Switch to global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to global EmbeddedXADataSource <closedconn>.close() no error
+Switch to global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+initial local
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+initial  X1
+  isolation level READ_COMMITTED
+  auto commit     false
+  read only       false
+modified X1
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+modified local
+  isolation level READ_UNCOMMITTED
+  auto commit     true
+  read only       true
+reset local
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+re-join X1
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+back to local (same as reset)
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+EVENT(6):connectionClosed
+new handle - local 
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+EVENT(6):connectionClosed
+re-join with new handle X1
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+EVENT(6):connectionClosed
+pre-X1 commit - local
+  isolation level REPEATABLE_READ
+  auto commit     true
+  read only       false
+pre-X1 commit - X1
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+post-X1 end - local
+  isolation level REPEATABLE_READ
+  auto commit     true
+  read only       false
+post-X1 commit - local
+  isolation level REPEATABLE_READ
+  auto commit     true
+  read only       false
+EVENT(6):connectionClosed
+TESTING RE_USE OF STATEMENT OBJECTS
+THE STATEMENT OBJECTS CAN NOT BE REUSED ACROSS LOCAL/GLOBAL CONNECTIONS BECAUSE, LOCAL CONNECTION CREATES THEM
+WITH HOLDABILITY TRUE WHEREAS GLOBAL CONNECTION CAN ONLY WORK WITH STATEMENTS WITH HOLDABILITY FALSE
+LOCK TABLE
+END LOCK TABLE
+Statement State @ Create 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+Statement State @ PS Create 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+Statement State @ CS Create 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+Params-local-1: ru(params) contents {3}
+sru1-local-1: ru(SN1) contents {1} {2} {3}
+Expecting exception because global transaction sru1-global-2 is trying to use a statement with holdability true
+sru1-global-2: SQL Exception: Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+sru2-global-3: ru(OAK2) contents {1} {2} {3}
+Expecting exception because global transaction sru1-global-4 is trying to use a statement with holdability true
+sru1-global-4: SQL Exception: Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Statement State @ GLOBAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+Statement State @ PS GLOBAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+Statement State @ CS GLOBAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+PASS: got exception because holdability is true on prepared statement and that is not allowed in global transactions
+Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+sru1-local-5: ru(SN1) contents {1} {2} {3}
+sru2-local-6: ru(OAK2) contents {1} {2} {3}
+sru3-local-7: ru(SF3) contents {1} {2} {3}
+Statement State @ LOCAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+Statement State @ PS LOCAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+Statement State @ CS LOCAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+Params-local-2: ru(params) contents {3}
+LOCK TABLE
+  xid row 0 lock count 4
+  xid row 1 lock count 14
+END LOCK TABLE
+sru1-local-8: ru(SN1) contents {1} {2} {3}
+sru2-local-9: ru(OAK2) contents {1} {2} {3}
+sru3-local-10: ru(SF3) contents {1} {2} {3}
+Statement State @ LOCAL 2 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+Statement State @ PS LOCAL 2 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+Statement State @ CS LOCAL 2
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+LOCK TABLE
+  xid row 0 lock count 4
+  xid row 1 lock count 12
+END LOCK TABLE
+sruBatch update counts : 1  1  2  1 :
+sruBatch: ru(null) contents {1} {2} {3} {4} {5} {6} {7} {8}
+XAConnection.getXAResource : No current connection.
+XAConnection.getConnection : No current connection.
+XAResource.start : XAException - No current connection.
+XAResource.end : XAException - No current connection.
+XAResource.commit : XAException - No current connection.
+XAResource.prepare : XAException - No current connection.
+XAResource.recover : XAException - No current connection.
+XAResource.prepare : XAException - No current connection.
+XAResource.isSameRM : XAException - No current connection.
+Patricio update count 1
+conn4 autcommit true
+acxs 1
+acxs 2
+autocommitxastart expected No current connection.
+acxs 1
+acxs 2
+autocommitxastart expected  : XAException - null
+acxs 3
+DataSource - EMPTY
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ004:Database '' not found.
+  getConnection(null, wilma) - XJ004:Database '' not found.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - connectionAttributes=databaseName=wombat
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ004:Database '' not found.
+  getConnection(null, wilma) - XJ004:Database '' not found.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - attributesAsPassword=true
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - attributesAsPassword=true, connectionAttributes=databaseName=kangaroo
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;databaseName=kangaroo;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;databaseName=kangaroo;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+Enable Authentication
+08006:Database 'wombat' shutdown.
+AUTHENTICATION NOW ENABLED
+DataSource - attributesAsPassword=true
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - attributesAsPassword=true, user=fred, password=databaseName=wombat;password=wilma
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - EMPTY
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - connectionAttributes=databaseName=wombat
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - attributesAsPassword=true
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - attributesAsPassword=true, user=fred, password=databaseName=wombat;password=wilma
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+XADataSource - EMPTY
+  getXAConnection() - 08006:Database not available
+  getXAConnection(null, null) - 08006:Database not available
+  getXAConnection(fred, null) - 08006:Database not available
+  getXAConnection(fred, wilma) - 08006:Database not available
+  getXAConnection(null, wilma) - 08006:Database not available
+  getXAConnection(null, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08006:Database not available
+XADataSource - databaseName=wombat
+  getXAConnection() - 08004:Connection refused : Invalid authentication.
+  getXAConnection(null, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, wilma) - OK
+  getXAConnection(null, wilma) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(null, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08004:Connection refused : Invalid authentication.
+XADataSource - connectionAttributes=databaseName=wombat
+  getXAConnection() - 08006:Database not available
+  getXAConnection(null, null) - 08006:Database not available
+  getXAConnection(fred, null) - 08006:Database not available
+  getXAConnection(fred, wilma) - 08006:Database not available
+  getXAConnection(null, wilma) - 08006:Database not available
+  getXAConnection(null, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08006:Database not available
+XADataSource - attributesAsPassword=true
+  getXAConnection() - 08006:Database not available
+  getXAConnection(null, null) - 08006:Database not available
+  getXAConnection(fred, null) - 08006:Database not available
+  getXAConnection(fred, wilma) - 08006:Database not available
+  getXAConnection(null, wilma) - 08006:Database not available
+  getXAConnection(null, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08006:Database not available
+XADataSource - databaseName=wombat, attributesAsPassword=true
+  getXAConnection() - 08004:Connection refused : Invalid authentication.
+  getXAConnection(null, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, wilma) - XJ028:The URL 'jdbc:derby:wombat;wilma' is not properly formed.
+  getXAConnection(null, wilma) - XJ028:The URL 'jdbc:derby:wombat;wilma' is not properly formed.
+  getXAConnection(null, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat;password=wilma) - OK
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08004:Connection refused : Invalid authentication.
+Completed checkDataSource

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDataSource30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,737 @@
+Running connection checks on Nested
+  isolation level 2
+  auto commit     false
+  read only       false
+Running JDBC 3.0 connection checks on DriverManager 
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on DriverManager 
+  isolation level 2
+  auto commit     true
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+DriverManager  <closedconn>.close() no error
+DriverManager  <closedconn>.createStatement() 08003 - No current connection.
+DriverManager  <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedDataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+EmbeddedDataSource <closedconn>.close() no error
+EmbeddedDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedConnectionPoolDataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(1):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedConnectionPoolDataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(1):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Changes rolled back OK in auto closed pooled connection
+EVENT(1):connectionClosed
+expected SQL Exception: No current connection.
+expected SQL Exception: No current connection.
+Running JDBC 3.0 connection checks on EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(3):connectionClosed
+method calls on a closed connection
+EmbeddedXADataSource <closedconn>.close() no error
+EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Changes rolled back OK in auto closed local XAConnection
+EVENT(3):connectionClosed
+ERROR XJ015: Derby system shutdown.
+Running connection checks on Nested
+  isolation level 2
+  auto commit     false
+  read only       false
+Running JDBC 3.0 connection checks on DriverManager 
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on DriverManager 
+  isolation level 2
+  auto commit     true
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+DriverManager  <closedconn>.close() no error
+DriverManager  <closedconn>.createStatement() 08003 - No current connection.
+DriverManager  <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedDataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+method calls on a closed connection
+EmbeddedDataSource <closedconn>.close() no error
+EmbeddedDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedConnectionPoolDataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(2):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedConnectionPoolDataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedConnectionPoolDataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(2):connectionClosed
+method calls on a closed connection
+EmbeddedConnectionPoolDataSource <closedconn>.close() no error
+EmbeddedConnectionPoolDataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedConnectionPoolDataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(4):connectionClosed
+method calls on a closed connection
+EmbeddedXADataSource <closedconn>.close() no error
+EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(4):connectionClosed
+method calls on a closed connection
+EmbeddedXADataSource <closedconn>.close() no error
+EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+EVENT(5):connectionClosed
+Running JDBC 3.0 connection checks on Global EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+Running connection checks on Global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Global EmbeddedXADataSource <closedconn>.close() no error
+Global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on Global EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+Running connection checks on Global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Global EmbeddedXADataSource <closedconn>.close() no error
+Global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on Switch to local EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on Switch to local EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to local EmbeddedXADataSource <closedconn>.close() no error
+Switch to local EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to local EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on Switch to local EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot issue savepoint when autoCommit is on.
+Running connection checks on Switch to local EmbeddedXADataSource
+  isolation level 2
+  auto commit     true
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to local EmbeddedXADataSource <closedconn>.close() no error
+Switch to local EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to local EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on Switch to global EmbeddedXADataSource
+  holdability     false
+JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+Running connection checks on Switch to global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to global EmbeddedXADataSource <closedconn>.close() no error
+Switch to global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+Running JDBC 3.0 connection checks on Switch to global EmbeddedXADataSource
+  holdability     true
+JDBC 3.0 savepoint SQL Exception: Cannot rollback a global transaction using the Connection, commit processing must go thru XAResource interface.
+Running connection checks on Switch to global EmbeddedXADataSource
+  isolation level 2
+  auto commit     false
+  read only       false
+  has warnings    false
+setTypeMap(EMPTY_MAP) - ok
+setTypeMap(null) - ok XJ081 - Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
+setTypeMap(map) - ok 0A000 - Feature not implemented: no details.
+EVENT(5):connectionClosed
+method calls on a closed connection
+Switch to global EmbeddedXADataSource <closedconn>.close() no error
+Switch to global EmbeddedXADataSource <closedconn>.createStatement() 08003 - No current connection.
+Switch to global EmbeddedXADataSource <closedstmt>.execute() XJ012 - 'Statement' already closed.
+initial local
+  holdability     true
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+initial  X1
+  holdability     false
+  isolation level READ_COMMITTED
+  auto commit     false
+  read only       false
+modified X1
+  holdability     false
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+modified local
+  holdability     false
+  isolation level READ_UNCOMMITTED
+  auto commit     true
+  read only       true
+reset local
+  holdability     false
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+re-join X1
+  holdability     false
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+back to local (same as reset)
+  holdability     false
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+EVENT(6):connectionClosed
+new handle - local 
+  holdability     true
+  isolation level READ_COMMITTED
+  auto commit     true
+  read only       false
+EVENT(6):connectionClosed
+re-join with new handle X1
+  holdability     true
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+EVENT(6):connectionClosed
+pre-X1 commit - local
+  holdability     true
+  isolation level REPEATABLE_READ
+  auto commit     true
+  read only       false
+pre-X1 commit - X1
+  holdability     true
+  isolation level READ_UNCOMMITTED
+  auto commit     false
+  read only       true
+post-X1 end - local
+  holdability     true
+  isolation level REPEATABLE_READ
+  auto commit     true
+  read only       false
+post-X1 commit - local
+  holdability     true
+  isolation level REPEATABLE_READ
+  auto commit     true
+  read only       false
+EVENT(6):connectionClosed
+TESTING RE_USE OF STATEMENT OBJECTS
+THE STATEMENT OBJECTS CAN NOT BE REUSED ACROSS LOCAL/GLOBAL CONNECTIONS BECAUSE, LOCAL CONNECTION CREATES THEM
+WITH HOLDABILITY TRUE WHEREAS GLOBAL CONNECTION CAN ONLY WORK WITH STATEMENTS WITH HOLDABILITY FALSE
+LOCK TABLE
+END LOCK TABLE
+Statement State @ Create 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+Statement State @ PS Create 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 1
+    1 type 4
+Statement State @ CS Create 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 2
+    1 type 12
+    2 type 12
+Params-local-1: ru(params) contents {3}
+sru1-local-1: ru(SN1) contents {1} {2} {3}
+Expecting exception because global transaction sru1-global-2 is trying to use a statement with holdability true
+sru1-global-2: SQL Exception: Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+sru2-global-3: ru(OAK2) contents {1} {2} {3}
+Expecting exception because global transaction sru1-global-4 is trying to use a statement with holdability true
+sru1-global-4: SQL Exception: Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Statement State @ GLOBAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+Statement State @ PS GLOBAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 1
+    1 type 4
+Statement State @ CS GLOBAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 2
+    1 type 12
+    2 type 12
+PASS: got exception because holdability is true on prepared statement and that is not allowed in global transactions
+Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+sru1-local-5: ru(SN1) contents {1} {2} {3}
+sru2-local-6: ru(OAK2) contents {1} {2} {3}
+sru3-local-7: ru(SF3) contents {1} {2} {3}
+Statement State @ LOCAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+Statement State @ PS LOCAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 1
+    1 type 4
+Statement State @ CS LOCAL 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 2
+    1 type 12
+    2 type 12
+Params-local-2: ru(params) contents {3}
+LOCK TABLE
+  xid row 0 lock count 4
+  xid row 1 lock count 14
+END LOCK TABLE
+sru1-local-8: ru(SN1) contents {1} {2} {3}
+sru2-local-9: ru(OAK2) contents {1} {2} {3}
+sru3-local-10: ru(SF3) contents {1} {2} {3}
+Statement State @ LOCAL 2 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 444
+  getMaxFieldSize() 713
+  getMaxRows() 19
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+Statement State @ PS LOCAL 2 
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 888
+  getMaxFieldSize() 317
+  getMaxRows() 91
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 1
+    1 type 4
+Statement State @ CS LOCAL 2
+  getResultSetType() SCROLL_INSENSITIVE
+  getResultSetConcurrency() READ_ONLY
+  getFetchDirection() REVERSE
+  getFetchSize() 999
+  getMaxFieldSize() 137
+  getMaxRows() 85
+  getResultSetHoldability() HOLD_CURSORS_OVER_COMMIT 
+  Parameter Count 2
+    1 type 12
+    2 type 12
+LOCK TABLE
+  xid row 0 lock count 4
+  xid row 1 lock count 12
+END LOCK TABLE
+sruBatch update counts : 1  1  2  1 :
+sruBatch: ru(null) contents {1} {2} {3} {4} {5} {6} {7} {8}
+XAConnection.getXAResource : No current connection.
+XAConnection.getConnection : No current connection.
+XAResource.start : XAException - No current connection.
+ERROR 08003: No current connection.
+XAResource.end : XAException - No current connection.
+ERROR 08003: No current connection.
+XAResource.commit : XAException - No current connection.
+ERROR 08003: No current connection.
+XAResource.prepare : XAException - No current connection.
+ERROR 08003: No current connection.
+XAResource.recover : XAException - No current connection.
+ERROR 08003: No current connection.
+XAResource.prepare : XAException - No current connection.
+ERROR 08003: No current connection.
+XAResource.isSameRM : XAException - No current connection.
+ERROR 08003: No current connection.
+Patricio update count 1
+conn4 autcommit true
+acxs 1
+acxs 2
+autocommitxastart expected No current connection.
+acxs 1
+acxs 2
+autocommitxastart expected  : XAException - null
+acxs 3
+DataSource - EMPTY
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ004:Database '' not found.
+  getConnection(null, wilma) - XJ004:Database '' not found.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - connectionAttributes=databaseName=wombat
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ004:Database '' not found.
+  getConnection(null, wilma) - XJ004:Database '' not found.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - attributesAsPassword=true
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - attributesAsPassword=true, connectionAttributes=databaseName=kangaroo
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;databaseName=kangaroo;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;databaseName=kangaroo;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+Enable Authentication
+08006:Database 'wombat' shutdown.
+AUTHENTICATION NOW ENABLED
+DataSource - attributesAsPassword=true
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+DataSource - attributesAsPassword=true, user=fred, password=databaseName=wombat;password=wilma
+  getConnection() - XJ004:Database '' not found.
+  getConnection(null, null) - XJ004:Database '' not found.
+  getConnection(fred, null) - XJ004:Database '' not found.
+  getConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - EMPTY
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - connectionAttributes=databaseName=wombat
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, wilma) - XJ004:Database '' not found.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - attributesAsPassword=true
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+ConnectionPoolDataSource - attributesAsPassword=true, user=fred, password=databaseName=wombat;password=wilma
+  getPooledConnection() - XJ004:Database '' not found.
+  getPooledConnection(null, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, null) - XJ004:Database '' not found.
+  getPooledConnection(fred, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, wilma) - XJ028:The URL 'jdbc:derby: ;wilma' is not properly formed.
+  getPooledConnection(null, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=wilma) - XJ004:Database '' not found.
+  getPooledConnection(fred, databaseName=wombat;password=betty) - XJ004:Database '' not found.
+XADataSource - EMPTY
+  getXAConnection() - 08006:Database not available
+  getXAConnection(null, null) - 08006:Database not available
+  getXAConnection(fred, null) - 08006:Database not available
+  getXAConnection(fred, wilma) - 08006:Database not available
+  getXAConnection(null, wilma) - 08006:Database not available
+  getXAConnection(null, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08006:Database not available
+XADataSource - databaseName=wombat
+  getXAConnection() - 08004:Connection refused : Invalid authentication.
+  getXAConnection(null, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, wilma) - OK
+  getXAConnection(null, wilma) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(null, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08004:Connection refused : Invalid authentication.
+XADataSource - connectionAttributes=databaseName=wombat
+  getXAConnection() - 08006:Database not available
+  getXAConnection(null, null) - 08006:Database not available
+  getXAConnection(fred, null) - 08006:Database not available
+  getXAConnection(fred, wilma) - 08006:Database not available
+  getXAConnection(null, wilma) - 08006:Database not available
+  getXAConnection(null, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08006:Database not available
+XADataSource - attributesAsPassword=true
+  getXAConnection() - 08006:Database not available
+  getXAConnection(null, null) - 08006:Database not available
+  getXAConnection(fred, null) - 08006:Database not available
+  getXAConnection(fred, wilma) - 08006:Database not available
+  getXAConnection(null, wilma) - 08006:Database not available
+  getXAConnection(null, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=wilma) - 08006:Database not available
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08006:Database not available
+XADataSource - databaseName=wombat, attributesAsPassword=true
+  getXAConnection() - 08004:Connection refused : Invalid authentication.
+  getXAConnection(null, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, null) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, wilma) - XJ028:The URL 'jdbc:derby:wombat;wilma' is not properly formed.
+  getXAConnection(null, wilma) - XJ028:The URL 'jdbc:derby:wombat;wilma' is not properly formed.
+  getXAConnection(null, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat) - 08004:Connection refused : Invalid authentication.
+  getXAConnection(fred, databaseName=wombat;password=wilma) - OK
+  getXAConnection(fred, databaseName=wombat;password=betty) - 08004:Connection refused : Invalid authentication.
+START XA HOLDABILITY TEST
+By default, autocommit is true for a connection
+Default holdability for a connection is HOLD_CURSORS_OVER_COMMIT
+CONNECTION(not in xa transaction yet) HOLDABILITY true
+Notice that autocommit now is false for connection because it is part of the global transaction
+Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction
+CONNECTION(in xa transaction) HOLDABILITY false
+This is a bug. Connection's holdability should have been CLOSE_CURSORS_AT_COMMIT since it is in the global transaction
+Have reported this on Derby dev-list
+CONNECTION(in xa transaction) HOLDABILITY true
+Autocommit on Connection inside global transaction has been set correctly to false
+CONNECTION(non-xa) HOLDABILITY false
+STATEMENT HOLDABILITY false
+STATEMENT HOLDABILITY false
+STATEMENT HOLDABILITY true
+PREPARED STATEMENT HOLDABILITY true
+CALLABLE STATEMENT HOLDABILITY true
+H@1 id 1
+H@2 id 2
+H@3 id 3
+CONNECTION(xa) HOLDABILITY false
+STATEMENT(this one was created with holdability false, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY false
+STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY true
+STATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY false
+PREPAREDSTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY false
+CALLABLESTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY false
+X@1 id 1
+X@2 id 2
+Expected SQLException No current connection.
+Expected SQLException No current connection.
+resume XA transaction and keep using rs
+Check holdability of various jdbc objects after resuming XA transaction
+CONNECTION(xa) HOLDABILITY false
+STATEMENT(this one was created with holdability false, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY false
+STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY true
+STATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY false
+PREPAREDSTATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY false
+CALLABLESTATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY false
+STATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY false
+PREPAREDSTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY false
+CALLABLESTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY false
+X@3 id 3
+Expected SQLException ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Expected SQLException ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Set connection to hold 
+CONNECTION(held) HOLDABILITY true
+CONNECTION(xa) HOLDABILITY false
+Expected SQLException(setHoldability) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Expected SQLException (Statement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Expected SQLException (PreparedStatement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Expected SQLException (CallableStatement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+STATEMENT HOLDABILITY true
+Expected SQLException (local Statement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Expected SQLException (local Statement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+PREPARED STATEMENT HOLDABILITY true
+Expected SQLException (local PreparedStatement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Expected SQLException (local PreparedStatement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+CALLABLE STATEMENT HOLDABILITY true
+Expected SQLException (local CallableStatement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+Expected SQLException (local CallableStatement hold) Cannot set holdability ResultSet.HOLD_CURSORS_OVER_COMMIT for a global transaction.
+CONNECTION(held) HOLDABILITY true
+PASS XA HOLDABILITY TEST
+Completed checkDataSource30

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkPoint.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkPoint.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkPoint.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,20 @@
+Test checkpoint starting
+CHECKPOINT WAS DONE
+Checking logs and Checkpoint at Insert:0
+Checking logs and Checkpoint at Insert:400
+Checking logs and Checkpoint at Insert:800
+Checking logs and Checkpoint at Insert:1200
+CHECKPOINT WAS DONE
+Checking logs and Checkpoint at Insert:1600
+Checking logs and Checkpoint at Insert:2000
+CHECKPOINT WAS DONE
+Checking logs and Checkpoint at Insert:2400
+Modifying the checkpoint/log intervals
+checkPointInterval:150001
+logSwitchInterval:150001
+Checking logs and Checkpoint at Insert:2800
+CHECKPOINT WAS DONE
+Checking logs and Checkpoint at Insert:3200
+CHECKPOINT WAS DONE
+database shutdown properly
+Test checkpoint finished

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out	Tue Jan 11 11:53:57 2005
@@ -7,7 +7,7 @@
 0 rows inserted/updated/deleted
 ij> maximumdisplaywidth 512;
 ij> CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> -- create tables

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/connectionJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,221 @@
+Test connection20 starting
+Got Same Connection Object
+Try to get connection using preaparedstatement
+Got Same Connection Object
+getObject(1)
+  as byte[] length 100
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getString(1) length 200
+43315858585858585858585858585858585858585858585858585858585858585858585858585858585858202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020
+getAsciiStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getBinaryStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getBytes(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getObject(2)
+  as byte[] length 43
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getString(2) length 86
+43325858585858585858585858585858585858585858585858585858585858585858585858585858585858
+getAsciiStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBinaryStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBytes(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getObject(3)
+  as byte[] length 43
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getString(3) length 86
+43335858585858585858585858585858585858585858585858585858585858585858585858585858585858
+getAsciiStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBinaryStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBytes(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getObject(4)
+  as String
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+getString(4) length 100
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+getAsciiStream(4)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getObject(5)
+  as String
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getString(5) length 45
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getAsciiStream(5)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+getObject(6)
+  as String
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getString(6) length 46
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getAsciiStream(6)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Got Same Statement Object
+getObject(1)
+  as byte[] length 100
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getString(1) length 200
+43315858585858585858585858585858585858585858585858585858585858585858585858585858585858202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020
+getAsciiStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getBinaryStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getBytes(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getObject(2)
+  as byte[] length 43
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getString(2) length 86
+43325858585858585858585858585858585858585858585858585858585858585858585858585858585858
+getAsciiStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBinaryStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBytes(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getObject(3)
+  as byte[] length 43
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getString(3) length 86
+43335858585858585858585858585858585858585858585858585858585858585858585858585858585858
+getAsciiStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBinaryStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getBytes(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+getObject(4)
+  as String
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+getString(4) length 100
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+getAsciiStream(4)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+getObject(5)
+  as String
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getString(5) length 45
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getAsciiStream(5)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+getObject(6)
+  as String
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getString(6) length 46
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+getAsciiStream(6)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Got Same Statement Object
+BIGINT
+LONG VARCHAR FOR BIT DATA
+VARCHAR () FOR BIT DATA
+CHAR () FOR BIT DATA
+LONG VARCHAR
+LONG NVARCHAR
+CHAR
+NATIONAL CHAR
+NUMERIC
+DECIMAL
+INTEGER
+SMALLINT
+FLOAT
+REAL
+DOUBLE
+VARCHAR
+NATIONAL CHAR VARYING
+DATE
+TIME
+TIMESTAMP
+BLOB
+CLOB
+Try to Get the connection back from metadata
+Got Same Connection Object
+ Try to get the connection back from a callable stmt
+Got Same Connection Object
+Test getConnection  finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/databaseProperties.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/databaseProperties.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/databaseProperties.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,177 @@
+ij> run resource '/org/apache/derbyTesting/functionTests/util/testRoutines.sql';
+ij> CREATE PROCEDURE TESTROUTINE.INSTALL_ROUTINES() MODIFIES SQL DATA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.installRoutines' language java parameter style java;
+0 rows inserted/updated/deleted
+ij> CALL TESTROUTINE.INSTALL_ROUTINES();
+0 rows inserted/updated/deleted
+ij> DROP PROCEDURE TESTROUTINE.INSTALL_ROUTINES;
+0 rows inserted/updated/deleted
+ij> CREATE FUNCTION GET_TABLE_PROPERTY (SCHEMA_NAME VARCHAR(128), TABLE_NAME VARCHAR(128), PROP_KEY VARCHAR(1000)) RETURNS VARCHAR(1000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestPropertyInfo.getTableProperty' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> -- Get a property that hasn't been set yet - should return null
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key1');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> -- Set a couple of properties
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('key1', 'one, two, three');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('key2', 'eins, zwei, drei');
+0 rows inserted/updated/deleted
+ij> -- and fetch them
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key1');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+one, two, three                                                                                                                 
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key2');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+eins, zwei, drei                                                                                                                
+ij> -- and delete one of theme
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('key2', null);
+0 rows inserted/updated/deleted
+ij> -- and fetch them
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key1');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+one, two, three                                                                                                                 
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key2');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> -- Now check some explicit properties
+-- ************ derby.storage.pageSize
+-- See what the default is first
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+4096                                                                                                                            
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- set the per-database value
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '16384');
+0 rows inserted/updated/deleted
+ij> -- this create table should pick up the per-database
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+16384                                                                                                                           
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- ************ derby.storage.minimumRecordSize
+-- See what the default is first
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.minimumRecordSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+12                                                                                                                              
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- set the per-database value
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', '42');
+0 rows inserted/updated/deleted
+ij> -- this create table should pick up the per-database
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.minimumRecordSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+42                                                                                                                              
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- ************ derby.storage.pageReservedSpace
+-- See what the default is first
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageReservedSpace');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+20                                                                                                                              
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- set the per-database value
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace', '17');
+0 rows inserted/updated/deleted
+ij> -- this create table should pick up the per-database
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageReservedSpace');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+17                                                                                                                              
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- ************ derby.database.noAutoBoot
+-- should be set in service.properties, not the conglomerate, but that's transparent here ... 
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.noAutoBoot', 'true');
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+true                                                                                                                            
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.noAutoBoot', 'false');
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+false                                                                                                                           
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.noAutoBoot', null);
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> -- Now check some explicit properties
+-- Now check with derby.storage.pageSize if derby.database.propertiesOnly
+-- ensures that system wide properties are ignored
+-- See is currently set, should be 16384
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+16384                                                                                                                           
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- set system value
+CALL TESTROUTINE.SET_SYSTEM_PROPERTY('derby.storage.pageSize', '8192');
+0 rows inserted/updated/deleted
+ij> -- this create table should pick up the system value - 8192
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+8192                                                                                                                            
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- 
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.propertiesOnly', 'true');
+0 rows inserted/updated/deleted
+ij> -- this create table should pick up the database value - 16384
+create table T (i int);
+0 rows inserted/updated/deleted
+ij> values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+16384                                                                                                                           
+ij> drop table T;
+0 rows inserted/updated/deleted
+ij> -- verify that creation time only properties may not be set.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.engineType', '9');
+ERROR XCY02: The requested property change is not supported 'derby.engineType'='9'.
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.engineType');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> drop function GET_TABLE_PROPERTY;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dbMetaDataJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,31 @@
+Test dbMetaDataJdbc30 starting
+JDBC Driver 'Apache Derby Embedded JDBC Driver', version 10.1 (10.1.0.0 alpha)
+The URL is: jdbc:derby:wombat
+supportsSavepoints() : true
+supportsNamedParameters() : false
+supportsMultipleOpenResults() : true
+supportsGetGeneratedKeys() : true
+supportsResultSetHoldability(HOLD_CURSORS_OVER_COMMIT) : true
+supportsResultSetHoldability(CLOSE_CURSORS_AT_COMMIT) : true
+getJDBCMajorVersion() : 3
+getJDBCMinorVersion() : 0
+getSQLStateType() : 2
+getResultSetHoldability() : 1
+getDatabaseMajorVersion() : 10
+getDatabaseMinorVersion() : 1
+supportsStatementPooling() : false
+getMaxColumnNameLength() = 30
+getMaxCursorNameLength() = 18
+getMaxSchemaNameLength() = 30
+getMaxProcedureNameLength() = 128
+getMaxTableNameLength() = 128
+getMaxUserNameLength() = 30
+getSuperTypes() with null :
+EXPECTED: Not Implemented Exception or empty  ResultSet
+getSuperTables() with null :
+EXPECTED: Not Implemented Exception or empty  ResultSet
+getAttributes() with null :
+EXPECTED: Not Implemented Exception or empty  ResultSet
+locatorsUpdateCopy(): 
+Expected : Feature not implemented: no details.
+Test dbMetaDataJdbc30 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurConnJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurConnJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/getCurConnJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,22 @@
+ij> -- test getCurConnJdbc20
+-- this test will get run under jdk12 only. If run under jdk11x, will get an exception like
+-- following for call to newToJdbc20Method
+-- ERROR 38000: The exception 'java.lang.NoSuchMethodError: java.sql.Connection: method 
+-- createStatement(II)Ljava/sql/Statement; not found' was thrown while evaluating an expression.
+-- method alias and table used later
+create procedure newToJdbc20Method() PARAMETER STYLE JAVA LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Jdbc20Test.newToJdbc20Method';
+0 rows inserted/updated/deleted
+ij> create table T (a int NOT NULL primary key);
+0 rows inserted/updated/deleted
+ij> insert into T values (1);
+1 row inserted/updated/deleted
+ij> -- now lets try a variety of errors
+call newToJdbc20Method();
+0 rows inserted/updated/deleted
+ij> ------------------------------------------------------------
+-- drop the table
+drop table T;
+0 rows inserted/updated/deleted
+ij> drop procedure newToJdbc20Method;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorJava.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorJava.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorJava.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+Creating table...
+done creating table and inserting data.
+Start multi table query with holdability true test
+value of t2.c22 is 1
+value of t2.c22 is 2
+Multi table query with holdability true test over
+Start isolation level change test
+Switch isolation while there are open cursors
+Should see exceptions
+ERROR X0X03: Invalid transaction state - held cursor requires same isolation level
+PASS: Can't change isolation if they are open cursor
+Isolation level change test over

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/iepnegativetests.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,323 @@
+ij> --testing error cases for import/export
+create schema iep;
+0 rows inserted/updated/deleted
+ij> create table iep.t1(a int);
+0 rows inserted/updated/deleted
+ij> insert into iep.t1 values(100) , (101) , (102) , (103) , (104) , (105) , (106);
+7 rows inserted/updated/deleted
+ij> --export error cases
+--export can not create file
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'nodir/t1.dat' , 
+                                 null, null, null) ;
+ERROR XIE0I: Got IOException while writing data to the file
+ij> --export table not found
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 'NOTABLE' , 'extinout/t1.dat' , 
+                                 null, null, null) ;
+ERROR 38000: The exception 'SQL Exception: Table 'IEP.NOTABLE' does not exist.' was thrown while evaluating an expression.
+ERROR 42X05: Table 'IEP.NOTABLE' does not exist.
+ij> ---export schema is not valid
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('XXXX', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null) ;
+ERROR 38000: The exception 'SQL Exception: Schema 'XXXX' does not exist' was thrown while evaluating an expression.
+ERROR 42Y07: Schema 'XXXX' does not exist
+ij> --export query is invalid (syntax error)
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select from t1', 
+                                    'extinout/t1.dat' , null, null, null) ;
+ERROR 38000: The exception 'SQL Exception: Syntax error: Encountered "from" at line 1, column 8.' was thrown while evaluating an expression.
+ERROR 42X01: Syntax error: Encountered "from" at line 1, column 8.
+ij> --export codeset is invalid
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from iep.t1', 
+                                    'extinout/t1.dat' , null, null, 'NOSUCHCODESET') ;
+ERROR XIE0I: Got IOException while writing data to the file
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('XXXX', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null) ;
+ERROR 38000: The exception 'SQL Exception: Schema 'XXXX' does not exist' was thrown while evaluating an expression.
+ERROR 42Y07: Schema 'XXXX' does not exist
+ij> --export delimiter errror cases
+--period can not be used as character ot column delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, '.', null) ;
+ERROR XIE0K: The period was specified as a character string delimiter.
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '.', null, null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> --same delimter can not be used as character and column delimters
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 ';', ';', null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> --space character can not be a delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 ' ', ';', null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, ' ', null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> --if emtry strinng is passed actual value delimiter should be space
+--and the that should become a invalid delimiter 
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '', ';', null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, '', null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> --more than one character passed to the delimiters get truncated to one
+--following one should give error because eventually '\' delimiter 
+--is used a both for char and col
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '\a', '\', null) ;
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> --DO A VALID EXPORT AND  IMPORT 
+set schema iep;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, null, 'utf-8') ;
+0 rows inserted/updated/deleted
+ij> delete from t1 ;
+7 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from t1;
+A          
+-----------
+100        
+101        
+102        
+103        
+104        
+105        
+106        
+ij> --import error cases
+--import can not find input file
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE('iep', 't1' , 'nodir/t1.dat' , 
+                                 null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE04: Data file not found: nodir/t1.dat
+ij> --import table not found
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 'NOTABLE' , 'extinout/t1.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE0M: Table 'IEP.NOTABLE' does not exist.
+ij> --import schema is not valid
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('XXXX', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE0M: Table 'XXXX.T1' does not exist.
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, null, 'INCORRECTCODESET', 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XJ001: Java exception: 'java.io.UnsupportedEncodingException: INCORRECTCODESET'.
+ij> --check import with invalid delimiter usage
+--if emtry strinng is passed actual value delimiter should be space
+--and the that should become a invalid delimiter 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '', ';', null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, '', null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> --same delimter can not be used as character and column delimters
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 ';', ';', null, 1) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE0J: A delimiter is not valid or is used more than once.
+ij> autocommit off;
+ij> create table v1(a int) ;
+0 rows inserted/updated/deleted
+ij> declare global temporary table session.temp1(c1 int) on commit preserve rows not logged;
+0 rows inserted/updated/deleted
+ij> insert into session.temp1 values(1) , (2) , (3) , (4) , (5) , (6);
+6 rows inserted/updated/deleted
+ij> select * from session.temp1;
+C1         
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+ij> --export to from a temporary table
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('session', 'temp1' , 'extinout/temp1.dat' , 
+                           null, null, null) ;
+0 rows inserted/updated/deleted
+ij> -- because temporary table has on commit preserve rows, commit issued by export will not delete data from the temp table.
+select * from session.temp1;
+C1         
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+ij> --import back to a regualr table
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 'v1' , 'extinout/temp1.dat' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from v1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+ij> commit;
+ij> --import to a temp table should fail with a table not found errror
+declare global temporary table session.temp2(c1 int) not logged;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('session', 'temp2' , 'extinout/temp1.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE0M: Table 'SESSION.TEMP2' does not exist.
+ij> select * from session.temp2 ;
+ERROR 42X05: Table 'SESSION.TEMP2' does not exist.
+ij> commit ;
+ij> drop table v1;
+0 rows inserted/updated/deleted
+ij> autocommit on;
+ij> create table t3(c1 int , c2 double , c3 decimal , c4 varchar(20) );
+0 rows inserted/updated/deleted
+ij> insert into t3 values(1 , 3.5 , 8.6 , 'test strings');
+1 row inserted/updated/deleted
+ij> insert into t3 values(2 , 3.5 , 8.6 , 'test strings');
+1 row inserted/updated/deleted
+ij> insert into t3 values(3 , 3.5 , 8.6 , 'test strings');
+1 row inserted/updated/deleted
+ij> insert into t3 values(4 , 3.5 , 8.6 , 'test strings');
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't3' , 'extinout/t3.dat' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't3' , 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from t3;
+C1         |C2                    |C3    |C4                  
+--------------------------------------------------------------
+1          |3.5                   |8     |test strings        
+2          |3.5                   |8     |test strings        
+3          |3.5                   |8     |test strings        
+4          |3.5                   |8     |test strings        
+1          |3.5                   |8     |test strings        
+2          |3.5                   |8     |test strings        
+3          |3.5                   |8     |test strings        
+4          |3.5                   |8     |test strings        
+ij> --import data column names are incorrect
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3, x4', null,
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE08: There is no column by name: x1
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3', '1,2,3,4', 
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE08: There is no column by name: x1
+ij> --import data insert column names count < column indexes does not match
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'c1, c2, c3', '1,2,3,4', 
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> --import data column indexes count > insert columns count
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'c1, c2, c3,c4', '1,2', 
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The number of values assigned is not the same as the number of specified or implied columns.' was thrown while evaluating an expression.
+ERROR 42802: The number of values assigned is not the same as the number of specified or implied columns.
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , null, '11,22,12,24', 
+                                 'extinout/t3.dat' , 
+				 null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: Column 'COLUMN11' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'COLUMN11' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 42X04: Column 'COLUMN11' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'COLUMN11' is not a column in the target table.
+ij> --repeat the above type cases with empty file and minor variation to paramters
+delete from t3 ;
+12 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't3' , 'extinout/t3.dat' , 
+                                  ';', '^', 'utf-16') ;
+0 rows inserted/updated/deleted
+ij> --import data column names are incorrect
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3, x4', null, 
+                                 'extinout/t3.dat' , 
+                                 ';', '^', 'utf-16', 1) ;
+ERROR XIE08: There is no column by name: x1
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3', '1,2,3,4', 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+ERROR XIE08: There is no column by name: x1
+ij> --import data insert column names count < column indexes does not match
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'c1, c2, c3', null, 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+0 rows inserted/updated/deleted
+ij> --import data column indexes count > insert columns count
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , null, '1,2', 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+ERROR 38000: The exception 'SQL Exception: The number of values assigned is not the same as the number of specified or implied columns.' was thrown while evaluating an expression.
+ERROR 42802: The number of values assigned is not the same as the number of specified or implied columns.
+ij> --specify column indexes that are not there in the file that is being  imported
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , null, '11,22,12,24', 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+0 rows inserted/updated/deleted
+ij> --import to a system table shoud fail
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('SYS', 'SYSTABLES' , 'extinout/t3.dat' , 
+                                      ';', '^', 'utf-16', 1) ;
+ERROR 38000: The exception 'SQL Exception: 'SYS.SYSTABLES' is a system table.  Users are not allowed to modify the contents of this table.' was thrown while evaluating an expression.
+ERROR 42Y25: 'SYS.SYSTABLES' is a system table.  Users are not allowed to modify the contents of this table.
+ij> ---not supported by db2 cloudscape import/export
+create table ntype(a int , ct CLOB(1024));
+0 rows inserted/updated/deleted
+ij> create table ntype1(bt BLOB(1024) , a int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 'ntype' , 'extinout/ntype.dat' , 
+                                 null, null, null) ;
+ERROR XIE0B: Column 'CT' in the table is of type CLOB, it is not supported by import/export.
+ij> call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from iep.ntype1',
+				   'extinout/ntype.dat' , 
+                                   null, null, null) ;
+ERROR XIE0B: Column 'BT' in the table is of type BLOB, it is not supported by import/export.
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 'ntype' , 'extinout/ntype.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE0B: Column 'CT' in the table is of type CLOB, it is not supported by import/export.
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 'ntype1' , null , null, 
+                                 'extinout/ntype.dat' , 
+                                 null, null, null, 0) ;
+ERROR XIE0B: Column 'BT' in the table is of type BLOB, it is not supported by import/export.
+ij> --import should aquire a lock on the table
+create table parent(a int not null primary key);
+0 rows inserted/updated/deleted
+ij> insert into parent values (1) , (2) , (3) , (4) ;
+4 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from parent where a < 3' , 'extinout/parent.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat' as c1;
+ij(C1)> connect 'jdbc:derby:wombat' as c2;
+ij(C2)> set connection c1;
+ij(C1)> autocommit off;
+ij(C1)> lock table iep.parent in share mode;
+0 rows inserted/updated/deleted
+ij(C1)> set connection c2;
+ij(C2)> autocommit off;
+ij(C2)> --following import should fail with lock time out
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.locks.waitTimeout', '5');
+0 rows inserted/updated/deleted
+ij(C2)> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE('iep', 'parent', 'extinout/parent.del',null, null, null,1);
+ERROR 38000: The exception 'SQL Exception: Table 'IEP.PARENT' cannot be locked in 'EXCLUSIVE' mode.' was thrown while evaluating an expression.
+ERROR X0X02: Table 'IEP.PARENT' cannot be locked in 'EXCLUSIVE' mode.
+ERROR 40XL1: A lock could not be obtained within the time requested
+ij(C2)> disconnect c1;
+ij(C2)> disconnect c2;
+ij> set connection connection0;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ieptests.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,737 @@
+ij> --table used for export
+create table ex_emp(id int , name char(7) , skills varchar(200), salary decimal(10,2)) ;
+0 rows inserted/updated/deleted
+ij> --table used for import
+create table imp_emp(id int , name char(7), skills varchar(200), salary decimal(10,2)) ;
+0 rows inserted/updated/deleted
+ij> --After an export from ex_emp and import to imp_emp both tables should have 
+--same data.
+--double delimter cases with default character delimter "
+--field seperator character inside a double delimited string as first line
+insert into ex_emp values(99, 'smith' , 'tennis"p,l,ayer"', 190.55) ;
+1 row inserted/updated/deleted
+ij> -- Perform Export:
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> -- Perform Import
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                      null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> insert into ex_emp values(100, 'smith' , 'tennis"player"', 190.55) ;
+1 row inserted/updated/deleted
+ij> insert into ex_emp values(101, 'smith' , 'tennis"player', 190.55) ;
+1 row inserted/updated/deleted
+ij> insert into ex_emp values(102, 'smith' , '"tennis"player', 190.55) ;
+1 row inserted/updated/deleted
+ij> insert into ex_emp values(103, 'smith' , '"tennis"player"', 190.55) ;
+1 row inserted/updated/deleted
+ij> insert into ex_emp values(104, 'smith' , '"tennis"""""""""""""""""""""""""""""""""""""player"', null) ;
+1 row inserted/updated/deleted
+ij> --empty string
+insert into ex_emp values(105, 'smith' , '""', 190.55) ;
+1 row inserted/updated/deleted
+ij> --just delimeter inside 
+insert into ex_emp values(106, 'smith' , '"""""""""""""""""""', 190.55);
+1 row inserted/updated/deleted
+ij> --null value
+insert into ex_emp values(107, 'smith"' , null, 190.55) ;
+1 row inserted/updated/deleted
+ij> --all values are nulls
+insert into ex_emp values(108, null , null, null) ;
+1 row inserted/updated/deleted
+ij> -- Perform Export:
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> -- Perform Import
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                      null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from ex_emp;
+ID         |NAME   |SKILLS                                                                                                                          |SALARY       
+------------------------------------------------------------------------------------------------------------------------------------------------------------------
+99         |smith  |tennis"p,l,ayer"                                                                                                                |190.55       
+100        |smith  |tennis"player"                                                                                                                  |190.55       
+101        |smith  |tennis"player                                                                                                                   |190.55       
+102        |smith  |"tennis"player                                                                                                                  |190.55       
+103        |smith  |"tennis"player"                                                                                                                 |190.55       
+104        |smith  |"tennis"""""""""""""""""""""""""""""""""""""player"                                                                             |NULL         
+105        |smith  |""                                                                                                                              |190.55       
+106        |smith  |"""""""""""""""""""                                                                                                             |190.55       
+107        |smith" |NULL                                                                                                                            |190.55       
+108        |NULL   |NULL                                                                                                                            |NULL         
+ij> select * from imp_emp;
+ID         |NAME   |SKILLS                                                                                                                          |SALARY       
+------------------------------------------------------------------------------------------------------------------------------------------------------------------
+99         |smith  |tennis"p,l,ayer"                                                                                                                |190.55       
+99         |smith  |tennis"p,l,ayer"                                                                                                                |190.55       
+100        |smith  |tennis"player"                                                                                                                  |190.55       
+101        |smith  |tennis"player                                                                                                                   |190.55       
+102        |smith  |"tennis"player                                                                                                                  |190.55       
+103        |smith  |"tennis"player"                                                                                                                 |190.55       
+104        |smith  |"tennis"""""""""""""""""""""""""""""""""""""player"                                                                             |NULL         
+105        |smith  |""                                                                                                                              |190.55       
+106        |smith  |"""""""""""""""""""                                                                                                             |190.55       
+107        |smith" |NULL                                                                                                                            |190.55       
+108        |NULL   |NULL                                                                                                                            |NULL         
+ij> --checking query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+1          
+-----------
+11         
+ij> delete from imp_emp where id < 105;
+7 rows inserted/updated/deleted
+ij> --export from ex_emp using the a query only rows that got deleted in imp_emp 
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from ex_emp where id < 105', 
+                                    'extinout/emp.dat' , null, null, null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                      null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> --checking query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+1          
+-----------
+10         
+ij> --export the columns in different column order than in the table.
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select name , salary , skills, id from ex_emp where id < 105', 
+                                    'extinout/emp.dat' , null, null, null) ;
+0 rows inserted/updated/deleted
+ij> -- import them in to a with order different than in the table;
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,'name, salary, skills, id', null,
+                                    'extinout/emp.dat', null, null, null, 1) ;
+0 rows inserted/updated/deleted
+ij> --check query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+1          
+-----------
+6          
+ij> -- do import replace into the table with table order but using column indexes
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,null, '4, 1, 3, 2',
+                                    'extinout/emp.dat', null, null, null, 1) ;
+0 rows inserted/updated/deleted
+ij> --check query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+1          
+-----------
+6          
+ij> --replace using insert column names and column indexes
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,'salary, id, skills, name', '2, 4, 3, 1',
+                                    'extinout/emp.dat', null, null, null, 1) ;
+0 rows inserted/updated/deleted
+ij> --check query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+1          
+-----------
+6          
+ij> ---testing with different delimiters
+-- single quote(') as character delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                    null, '''', null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                    null, '''', null, 1) ;
+0 rows inserted/updated/deleted
+ij> select * from imp_emp ;
+ID         |NAME   |SKILLS                                                                                                                          |SALARY       
+------------------------------------------------------------------------------------------------------------------------------------------------------------------
+99         |smith  |tennis"p,l,ayer"                                                                                                                |190.55       
+100        |smith  |tennis"player"                                                                                                                  |190.55       
+101        |smith  |tennis"player                                                                                                                   |190.55       
+102        |smith  |"tennis"player                                                                                                                  |190.55       
+103        |smith  |"tennis"player"                                                                                                                 |190.55       
+104        |smith  |"tennis"""""""""""""""""""""""""""""""""""""player"                                                                             |NULL         
+105        |smith  |""                                                                                                                              |190.55       
+106        |smith  |"""""""""""""""""""                                                                                                             |190.55       
+107        |smith" |NULL                                                                                                                            |190.55       
+108        |NULL   |NULL                                                                                                                            |NULL         
+ij> -- single quote(') as column delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                    '''',null, null) ;
+0 rows inserted/updated/deleted
+ij> delete from imp_emp ;
+10 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                    '''', null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from imp_emp;
+ID         |NAME   |SKILLS                                                                                                                          |SALARY       
+------------------------------------------------------------------------------------------------------------------------------------------------------------------
+99         |smith  |tennis"p,l,ayer"                                                                                                                |190.55       
+100        |smith  |tennis"player"                                                                                                                  |190.55       
+101        |smith  |tennis"player                                                                                                                   |190.55       
+102        |smith  |"tennis"player                                                                                                                  |190.55       
+103        |smith  |"tennis"player"                                                                                                                 |190.55       
+104        |smith  |"tennis"""""""""""""""""""""""""""""""""""""player"                                                                             |NULL         
+105        |smith  |""                                                                                                                              |190.55       
+106        |smith  |"""""""""""""""""""                                                                                                             |190.55       
+107        |smith" |NULL                                                                                                                            |190.55       
+108        |NULL   |NULL                                                                                                                            |NULL         
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 '*', '%', null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 '*', '%', null, 1) ;
+0 rows inserted/updated/deleted
+ij> select * from imp_emp ;
+ID         |NAME   |SKILLS                                                                                                                          |SALARY       
+------------------------------------------------------------------------------------------------------------------------------------------------------------------
+99         |smith  |tennis"p,l,ayer"                                                                                                                |190.55       
+100        |smith  |tennis"player"                                                                                                                  |190.55       
+101        |smith  |tennis"player                                                                                                                   |190.55       
+102        |smith  |"tennis"player                                                                                                                  |190.55       
+103        |smith  |"tennis"player"                                                                                                                 |190.55       
+104        |smith  |"tennis"""""""""""""""""""""""""""""""""""""player"                                                                             |NULL         
+105        |smith  |""                                                                                                                              |190.55       
+106        |smith  |"""""""""""""""""""                                                                                                             |190.55       
+107        |smith" |NULL                                                                                                                            |190.55       
+108        |NULL   |NULL                                                                                                                            |NULL         
+ij> --cases for identity columns
+--create table emp1(id int generated always as identity (start with 100), name char(7), 
+--              skills varchar(200), salary decimal(10,2),skills varchar(200));
+--check import export with real and double that can not be explictitly
+--casted from VARCHAR type .
+create table noncast(c1 double , c2 real ) ;
+0 rows inserted/updated/deleted
+ij> insert into noncast values(1.5 , 6.7 ) ;
+1 row inserted/updated/deleted
+ij> insert into noncast values(2.5 , 8.999) ;
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('APP' , 'noncast' , 'extinout/noncast.dat'  , null , null , null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'noncast' , 'extinout/noncast.dat'  , null , null , null , 0) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'noncast', 'c2 , c1' , '2, 1' , 
+                                   'extinout/noncast.dat'  , null , null , null , 0) ;
+0 rows inserted/updated/deleted
+ij> select * from noncast ;
+C1                    |C2           
+------------------------------------
+1.5                   |6.7          
+2.5                   |8.999        
+1.5                   |6.7          
+2.5                   |8.999        
+1.5                   |6.7          
+2.5                   |8.999        
+ij> --check import/export of time types
+CREATE TABLE   TTYPES(DATETYPE DATE, TIMETYPE TIME, TSTAMPTYPE TIMESTAMP );
+0 rows inserted/updated/deleted
+ij> insert into ttypes values('1999-09-09' , '12:15:19' , 'xxxxxxFILTERED-TIMESTAMPxxxxx);
+1 row inserted/updated/deleted
+ij> insert into ttypes values('2999-12-01' , '13:16:10' , 'xxxxxxFILTERED-TIMESTAMPxxxxx);
+1 row inserted/updated/deleted
+ij> insert into ttypes values('3000-11-02' , '14:17:21' , 'xxxxxxFILTERED-TIMESTAMPxxxxx);
+1 row inserted/updated/deleted
+ij> insert into ttypes values('2004-04-03' , '15:18:31' , 'xxxxxxFILTERED-TIMESTAMPxxxxx);
+1 row inserted/updated/deleted
+ij> insert into ttypes values(null , null , null);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ttypes' , 'extinout/ttypes.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ttypes' , 'extinout/ttypes.del' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from ttypes;
+DATETYPE  |TIMETYPE|TSTAMPTYPE                
+----------------------------------------------
+1999-09-09|12:15:19|xxxxxxFILTERED-TIMESTAMPxxxxx
+2999-12-01|13:16:10|xxxxxxFILTERED-TIMESTAMPxxxxx
+3000-11-02|14:17:21|xxxxxxFILTERED-TIMESTAMPxxxxx
+2004-04-03|15:18:31|xxxxxxFILTERED-TIMESTAMPxxxxx
+NULL      |NULL    |NULL                      
+1999-09-09|12:15:19|xxxxxxFILTERED-TIMESTAMPxxxxx
+2999-12-01|13:16:10|xxxxxxFILTERED-TIMESTAMPxxxxx
+3000-11-02|14:17:21|xxxxxxFILTERED-TIMESTAMPxxxxx
+2004-04-03|15:18:31|xxxxxxFILTERED-TIMESTAMPxxxxx
+NULL      |NULL    |NULL                      
+ij> ---Import should commit on success and rollback on any failures
+autocommit off ;
+ij> create table t1(a int ) ;
+0 rows inserted/updated/deleted
+ij> insert into t1 values(1) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(2) ;
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> --above import should have committed , following rollback should be a noop.
+rollback;
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+1          
+2          
+ij> insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> --file not found error should rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/nofile.del' , 
+                                 null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE04: Data file not found: extinout/nofile.del
+ij> commit;
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+1          
+2          
+ij> insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> --table not found error should issue a implicit rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'notable' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+ERROR XIE0M: Table 'NOTABLE' does not exist.
+ij> commit ;
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+1          
+2          
+ij> delete from t1;
+4 rows inserted/updated/deleted
+ij> ---check commit/rollback with replace options using 
+insert into t1 values(1) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(2) ;
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> --above export should have a commit.rollback below should be a noop
+rollback;
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null, 1) ;
+0 rows inserted/updated/deleted
+ij> --above import should have committed , following rollback should be a noop.
+rollback;
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+ij> insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> --file not found error should rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/nofile.del' , 
+                                 null, null, null, 1) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE04: Data file not found: extinout/nofile.del
+ij> commit;
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+ij> insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> --table not found error should issue a implicit rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'notable' , 'extinout/t1.del' , 
+                                 null, null, null, 1) ;
+ERROR XIE0M: Table 'NOTABLE' does not exist.
+ij> commit ;
+ij> ---check IMPORT_DATA calls commit/rollback
+select * from t1 ;
+A          
+-----------
+1          
+2          
+ij> delete from t1;
+2 rows inserted/updated/deleted
+ij> ---check commit/rollback with replace options using 
+insert into t1 values(1) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(2) ;
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1' , 'a' , '1' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> --above import should have committed , following rollback should be a noop.
+rollback;
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+1          
+2          
+ij> insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> --file not found error should rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1', 'a' , '1'  , 'extinout/nofile.del' , 
+                                 null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE04: Data file not found: extinout/nofile.del
+ij> commit;
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+1          
+2          
+ij> insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> --table not found error should issue a implicit rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'notable' , 'a' , '1', 'extinout/t1.del' , 
+                                 null, null, null, 1) ;
+ERROR XIE0M: Table 'NOTABLE' does not exist.
+ij> commit ;
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+1          
+2          
+ij> autocommit on ;
+ij> --make sure commit import code is ok in autcommit mode.
+insert into t1 values(3) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1' , 'a' , '1' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+1          
+2          
+3          
+4          
+1          
+2          
+ij> insert into t1 values(5) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(6) ;
+1 row inserted/updated/deleted
+ij> --following import will back , but should not have any impact on inserts
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1', 'a' , '1'  , 'extinout/nofile.del' , 
+                                 null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.' was thrown while evaluating an expression.
+ERROR 38000: The exception 'java.lang.reflect.InvocationTargetException' was thrown while evaluating an expression.
+ERROR XJ001: Java exception: ': java.lang.reflect.InvocationTargetException'.
+ERROR XIE04: Data file not found: extinout/nofile.del
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+1          
+2          
+3          
+4          
+1          
+2          
+5          
+6          
+ij> --END IMPORT COMMIT/ROLLBACK TESTSING
+---all types supported by DB2 cloudscape import/export
+create table alltypes(chartype char(20) , 
+	          biginttype bigint , 
+		  datetype date , 
+		  decimaltype decimal(10,5) , 
+		  doubletype double , 
+		  inttype integer , 
+		  lvartype long varchar , 
+		  realtype real , 
+		  sminttype smallint , 
+		  timetype time , 
+		  tstamptype timestamp , 
+		  vartype varchar(50));
+0 rows inserted/updated/deleted
+ij> insert into  alltypes values('chartype string' ,
+                          9223372036854775807,
+                         '1993-10-29' ,
+                          12345.54321,
+                          10E307,
+                          2147483647,
+                          'long varchar testing',
+                          10E3,
+                          32767,
+                          '09.39.43',
+                          'xxxxxxFILTERED-TIMESTAMPxxxxx,
+                          'varchar testing');
+1 row inserted/updated/deleted
+ij> insert into  alltypes values('chartype string' ,
+                          -9223372036854775808,
+                         '1993-10-29' ,
+                          0.0,
+                          -10E307,
+                          -2147483647,
+                          'long varchar testing',
+                          -10E3,
+                          32767,
+                          '09.39.43',
+                          'xxxxxxFILTERED-TIMESTAMPxxxxx,
+                          'varchar testing');
+1 row inserted/updated/deleted
+ij> insert into  alltypes values('"chartype" string' , 
+                              9223372036854775807,
+                             '1993-10-29' , 
+                              -12345.54321,
+                              10E307,
+                              2147483647,
+                              'long "varchar" testing',
+                              10E3,
+                              32767,
+                              '09.39.43',
+                              'xxxxxxFILTERED-TIMESTAMPxxxxx,
+                              '"varchar" testing');
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select * from alltypes ;
+CHARTYPE            |BIGINTTYPE          |DATETYPE  |DECIMALTYPE  |DOUBLETYPE            |INTTYPE    |LVARTYPE                                                                                                                        |REALTYPE     |SMINT&|TIMETYPE|TSTAMPTYPE                |VARTYPE                                           
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+chartype string     |9223372036854775807 |1993-10-29|12345.54321  |1.0E308               |2147483647 |long varchar testing                                                                                                            |10000.0      |32767 |09:39:43|xxxxxxFILTERED-TIMESTAMPxxxxx|varchar testing                                   
+chartype string     |-9223372036854775808|1993-10-29|0.00000      |-1.0E308              |-2147483647|long varchar testing                                                                                                            |-10000.0     |32767 |09:39:43|xxxxxxFILTERED-TIMESTAMPxxxxx|varchar testing                                   
+"chartype" string   |9223372036854775807 |1993-10-29|-12345.54321 |1.0E308               |2147483647 |long "varchar" testing                                                                                                          |10000.0      |32767 |09:39:43|xxxxxxFILTERED-TIMESTAMPxxxxx|"varchar" testing                                 
+chartype string     |9223372036854775807 |1993-10-29|12345.54321  |1.0E308               |2147483647 |long varchar testing                                                                                                            |10000.0      |32767 |09:39:43|xxxxxxFILTERED-TIMESTAMPxxxxx|varchar testing                                   
+chartype string     |-9223372036854775808|1993-10-29|0.00000      |-1.0E308              |-2147483647|long varchar testing                                                                                                            |-10000.0     |32767 |09:39:43|xxxxxxFILTERED-TIMESTAMPxxxxx|varchar testing                                   
+"chartype" string   |9223372036854775807 |1993-10-29|-12345.54321 |1.0E308               |2147483647 |long "varchar" testing                                                                                                          |10000.0      |32767 |09:39:43|xxxxxxFILTERED-TIMESTAMPxxxxx|"varchar" testing                                 
+ij> delete from alltypes;
+6 rows inserted/updated/deleted
+ij> --import should work with trigger enabled on append and should not work on replace
+create table test1(a char(20)) ;
+0 rows inserted/updated/deleted
+ij> create trigger trig_import after INSERT on alltypes
+referencing new as newrow
+for each  row mode db2sql
+insert into test1 values(newrow.chartype);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> select count(*) from alltypes ;
+1          
+-----------
+3          
+ij> select * from test1;
+A                   
+--------------------
+chartype string     
+chartype string     
+"chartype" string   
+ij> delete from alltypes;
+3 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null, 1) ;
+ERROR 38000: The exception 'SQL Exception: Bulk insert replace is not permitted on 'APP.ALLTYPES' because it has an enabled trigger (TRIG_IMPORT).' was thrown while evaluating an expression.
+ERROR 42Z08: Bulk insert replace is not permitted on 'APP.ALLTYPES' because it has an enabled trigger (TRIG_IMPORT).
+ij> select count(*) from alltypes;
+1          
+-----------
+0          
+ij> drop trigger trig_import;
+0 rows inserted/updated/deleted
+ij> drop table test1;
+0 rows inserted/updated/deleted
+ij> --test importing to identity columns
+create table table1(c1 char(30), 
+       c2 int generated always as identity,
+       c3 real,
+       c4 char(1));
+0 rows inserted/updated/deleted
+ij> create table table2(c1 char(30), 
+       c2 int,
+       c3 real,
+       c4 char(1));
+0 rows inserted/updated/deleted
+ij> insert into table2 values('Robert',100, 45.2, 'J');
+1 row inserted/updated/deleted
+ij> insert into table2 values('Mike',101, 76.9, 'K');
+1 row inserted/updated/deleted
+ij> insert into table2 values('Leo',102, 23.4, 'I');
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select c1,c3,c4 from table2' , 'extinout/import.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(NULL,'table1', 'c1,c3,c4' , null, 'extinout/import.del',null, null,null,0);
+0 rows inserted/updated/deleted
+ij> select * from table1;
+C1                            |C2         |C3           |C4  
+-------------------------------------------------------------
+Robert                        |1          |45.2         |J   
+Mike                          |2          |76.9         |K   
+Leo                           |3          |23.4         |I   
+ij> delete from table1;
+3 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null , 'table2' , 'extinout/import.del',  null, null, null) ;
+0 rows inserted/updated/deleted
+ij> --following import should fail becuase of inserting into identity column.
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'table1', 'extinout/import.del',null, null, null,1);
+ERROR 38000: The exception 'SQL Exception: Attempt to modify an identity column 'C2'.' was thrown while evaluating an expression.
+ERROR 42Z23: Attempt to modify an identity column 'C2'. 
+ij> --following import should be succesful
+CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(NULL, 'table1', 'c1,c3,c4' , '1,3,4', 'extinout/import.del',null, null, null,1);
+0 rows inserted/updated/deleted
+ij> select * from table1;
+C1                            |C2         |C3           |C4  
+-------------------------------------------------------------
+Robert                        |1          |45.2         |J   
+Mike                          |2          |76.9         |K   
+Leo                           |3          |23.4         |I   
+ij> update table2 set c2=null;
+3 rows inserted/updated/deleted
+ij> --check null values import to identity columns should also fail
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null , 'table2' , 'extinout/import.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'table1', 'extinout/import.del',null, null, null,1);
+ERROR 38000: The exception 'SQL Exception: Attempt to modify an identity column 'C2'.' was thrown while evaluating an expression.
+ERROR 42Z23: Attempt to modify an identity column 'C2'. 
+ij> select * from table1;
+C1                            |C2         |C3           |C4  
+-------------------------------------------------------------
+Robert                        |1          |45.2         |J   
+Mike                          |2          |76.9         |K   
+Leo                           |3          |23.4         |I   
+ij> --check that replace fails when there dependents and replaced data 
+--does not violate foreign key constraints.
+create table parent(a int not null primary key);
+0 rows inserted/updated/deleted
+ij> insert into parent values (1) , (2) , (3) , (4) ;
+4 rows inserted/updated/deleted
+ij> create table child(b int references parent(a));
+0 rows inserted/updated/deleted
+ij> insert into child values (1) , (2) , (3) , (4) ;
+4 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from parent where a < 3' , 'extinout/parent.del' , 
+                                 null, null, null) ;
+0 rows inserted/updated/deleted
+ij> --replace should fail because of dependent table
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'parent', 'extinout/parent.del',null, null, null,1);
+ERROR 38000: The exception 'SQL Exception: INSERT on table 'PARENT' caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled back.' was thrown while evaluating an expression.
+ERROR 23503: INSERT on table 'PARENT' caused a violation of foreign key constraint 'xxxxGENERATED-IDxxxx' for key (3).  The statement has been rolled back.
+ij> select * from parent;
+A          
+-----------
+1          
+2          
+3          
+4          
+ij> ---test with a file which has a differen records seperators (\n, \r , \r\n)
+create table nt1( a int , b char(30));
+0 rows inserted/updated/deleted
+ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'nt1', 'extin/mixednl.del',null, null, null,0);
+0 rows inserted/updated/deleted
+ij> select * from nt1;
+A          |B                             
+------------------------------------------
+0          |XXXXXX0                       
+1          |XXXXXX1                       
+2          |XXXXXX2                       
+3          |XXXXXX3                       
+4          |XXXXXX4                       
+5          |YYYYY5                        
+6          |YYYYY6                        
+7          |YYYYY7                        
+8          |YYYYY8                        
+9          |YYYYY9                        
+10         |ZZZZZZ10                      
+11         |ZZZZZZ11                      
+12         |ZZZZZZ12                      
+13         |ZZZZZZ13                      
+14         |ZZZZZZ14                      
+ij> drop table nt1 ;
+0 rows inserted/updated/deleted
+ij> --test case for bug 5977;(with lot of text data)
+create table position_info
+    (
+       position_code varchar(10) not null ,
+       literal_no int not null ,
+       job_category_code varchar(10),
+       summary_description long varchar,
+       detail_description long varchar,
+       web_flag varchar(1)
+    );
+0 rows inserted/updated/deleted
+ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ('APP', 'position_info', 'extin/position_info.del',
+                                    null, null, null, 1);
+0 rows inserted/updated/deleted
+ij> select count(*) from position_info ;
+1          
+-----------
+680        
+ij> select detail_description from position_info where position_code='AG1000';
+DETAIL_DESCRIPTION                                                                                                              
+--------------------------------------------------------------------------------------------------------------------------------
+Essential Duties and Responsibilities (include but not limited to):
+*Assist the director in his work activities in leading the&
+ij> CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE ('APP', 'position_info', 'extinout/pinfo.del',
+                                    null, null, null);
+0 rows inserted/updated/deleted
+ij> delete from position_info;
+680 rows inserted/updated/deleted
+ij> CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ('APP', 'position_info', 'extinout/pinfo.del',
+                                    null, null, null, 1);
+0 rows inserted/updated/deleted
+ij> select count(*) from position_info ;
+1          
+-----------
+680        
+ij> select detail_description from position_info where position_code='AG1000';
+DETAIL_DESCRIPTION                                                                                                              
+--------------------------------------------------------------------------------------------------------------------------------
+Essential Duties and Responsibilities (include but not limited to):
+*Assist the director in his work activities in leading the&
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,90 @@
+ij> -- this test shows the ij commands in use,
+-- and what happens when invalid stuff is entered.
+-- no driver loaded yet, detected off of the url
+-- this one is a bad url:
+connect 'cloudscape:wombat';
+ERROR 08001: No suitable driver
+ij> -- this one will work.
+connect 'jdbc:derby:wombat';
+ERROR XJ004: Database 'wombat' not found.
+ij> -- no connection yet, this will fail
+create table t (i int);
+IJ ERROR: Unable to establish connection
+ij> -- no table yet, this will fail
+select i from t;
+IJ ERROR: Unable to establish connection
+ij> -- invalid syntax ... incomplete statements
+driver;
+IJ ERROR: Unable to establish connection
+ij> connect;
+IJ ERROR: Unable to establish connection
+ij> prepare;
+IJ ERROR: Unable to establish connection
+ij> execute;
+IJ ERROR: Unable to establish connection
+ij> run;
+IJ ERROR: Unable to establish connection
+ij> remove;
+IJ ERROR: Unable to establish connection
+ij> -- should fail because procedure is an illegal statement name
+prepare procedure as 'select * from bar';
+IJ ERROR: procedure is an illegal name for a statement
+ij> -- should fail because text is passed on to derby, which
+-- barfs on the unknown statement name. execute procedure is
+-- a foundation 2000 concept
+execute procedure sqlj.install_jar( 'file:c:/p4c/systest/out/DigIt.jar', 'SourceWUs', 1 );
+IJ ERROR: Unable to establish connection
+ij> -- and, the help output:
+help;
+ Supported commands include:
+  PROTOCOL 'JDBC protocol' [ AS ident ];
+                               -- sets a default or named protocol
+  DRIVER 'class for driver';   -- loads the named class
+  CONNECT 'url for database' [ PROTOCOL namedProtocol ] [ AS connectionName ];
+                               -- connects to database URL
+                               -- and may assign identifier
+  SET CONNECTION connectionName; -- switches to the specified connection
+  SHOW CONNECTIONS;            -- lists all connections
+  AUTOCOMMIT [ ON | OFF ];     -- sets autocommit mode for the connection
+  DISCONNECT [ CURRENT | connectionName | ALL ];
+                               -- drop current, named, or all connections;
+                               -- the default is CURRENT
+  COMMIT;                      -- commits the current transaction
+  ROLLBACK;                    -- rolls back the current transaction
+  PREPARE name AS 'SQL-J text'; -- prepares the SQL-J text
+  EXECUTE { name | 'SQL-J text' } [ USING { name | 'SQL-J text' } ] ;
+                               -- executes the statement with parameter
+                               -- values from the USING result set row
+  REMOVE name;                 -- removes the named previously prepared statement
+  RUN 'filename';              -- run commands from the named file
+  ELAPSEDTIME [ ON | OFF ];    -- sets elapsed time mode for ij
+  MAXIMUMDISPLAYWIDTH integerValue;
+                               -- sets the maximum display width for
+                               -- each column to integerValue
+  ASYNC name 'SQL-J text';     -- run the command in another thread
+  WAIT FOR name;               -- wait for result of ASYNC'd command
+  GET [SCROLL INSENSITIVE] CURSOR name AS 'SQL-J query';
+                               -- gets a cursor (JDBC result set) on the query
+                               -- SCROLL cursors are only available 
+                               -- in JDBC 2.0 and higher. 
+                               -- (Cursor scroll type is ignored in JDBC 1.X.) 
+  NEXT name;                   -- gets the next row from the named cursor
+  FIRST name;                  -- gets the first row from the named scroll cursor
+  LAST name;                   -- gets the last row from the named scroll cursor
+  PREVIOUS name;               -- gets the previous row from the named scroll cursor
+  ABSOLUTE integer name;       -- positions the named scroll cursor at the absolute row number
+                               -- (A negative number denotes position from the last row.) 
+  RELATIVE integer name;       -- positions the named scroll cursor relative to the current row
+                               -- (integer is number of rows)
+  AFTER LAST name;             -- positions the named scroll cursor after the last row
+  BEFORE FIRST name;           -- positions the named scroll cursor before the first row
+  GETCURRENTROWNUMBER name;    -- returns the row number for the current position of the named scroll cursor
+                               -- (0 is returned when the cursor is not positioned on a row.) 
+  CLOSE name;                  -- closes the named cursor
+  UNICODEESCAPE [ ON | OFF ]; -- sets unicode escape mode for the input stream
+  LOCALIZEDDISPLAY [ ON | OFF ];
+                               -- controls locale sensitive data representation
+  EXIT;                        -- exits ij
+  HELP;                        -- shows this message
+ Any unrecognized commands are treated as potential SQL-J commands and executed directly.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij2.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij2.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij2.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,137 @@
+ij> -- this test shows some ij abilities against an active database
+create table t (i int);
+0 rows inserted/updated/deleted
+ij> insert into t values (3), (4);
+2 rows inserted/updated/deleted
+ij> prepare s as 'select * from t';
+ij> execute s;
+I          
+-----------
+3          
+4          
+ij> remove s;
+ij> -- now it won't find s
+execute s;
+IJ ERROR: Unable to establish prepared statement S
+ij> prepare s as 'select * from t where i=?';
+ij> -- fails, needs parameter
+execute s;
+ERROR 07000: At least one parameter to the current statement is uninitialized.
+ij> -- works, finds value
+execute s using 'values 3';
+IJ WARNING: Autocommit may close using result set
+I          
+-----------
+3          
+ij> prepare t as 'values 3';
+ij> -- same as last execute
+execute s using t;
+IJ WARNING: Autocommit may close using result set
+I          
+-----------
+3          
+ij> -- same as last execute
+execute 'select * from t where i=?' using 'values 3';
+IJ WARNING: Autocommit may close using result set
+I          
+-----------
+3          
+ij> -- same as last execute
+execute 'select * from t where i=?' using t;
+IJ WARNING: Autocommit may close using result set
+I          
+-----------
+3          
+ij> -- param that is not needed gets out of range message
+execute 'select * from t where i=?' using 'values (3,4)';
+IJ WARNING: Autocommit may close using result set
+ERROR XCL13: The parameter position '2' is out of range.  The number of parameters for this prepared  statement is '1'.
+ij> -- ignores rows that are not needed
+execute 'select * from t where i=?' using 'values 3,4';
+IJ WARNING: Autocommit may close using result set
+I          
+-----------
+3          
+ij> -- with autocommit off, extra rows are processed and no warning results
+autocommit off;
+ij> execute 'select * from t where i=?' using 'values 3,4';
+I          
+-----------
+3          
+I          
+-----------
+4          
+ij> execute 'select * from t where i=?' using 'values 3';
+I          
+-----------
+3          
+ij> autocommit on;
+ij> -- will say params not set when no rows in using values
+execute 'select * from t where i=?' using 'select * from t where i=9';
+IJ ERROR: Using clause had no results
+ij> -- will say params not set when using values is not a query
+execute 'select * from t where i=?' using 'create table s (i int)';
+IJ ERROR: Using clause had no results
+ij> -- note that the using part was, however, executed...
+drop table s;
+0 rows inserted/updated/deleted
+ij> -- bug 5926 - make sure the using clause result set got closed
+drop table t;
+0 rows inserted/updated/deleted
+ij> create table t(c1 int);
+0 rows inserted/updated/deleted
+ij> insert into t values(1);
+1 row inserted/updated/deleted
+ij> execute 'select * from t where c1=?' using 'select * from t where c1=1';
+IJ WARNING: Autocommit may close using result set
+C1         
+-----------
+1          
+ij> drop table t;
+0 rows inserted/updated/deleted
+ij> create table t(c1 int);
+0 rows inserted/updated/deleted
+ij> insert into t values(1);
+1 row inserted/updated/deleted
+ij> insert into t values(2);
+1 row inserted/updated/deleted
+ij> execute 'select * from t where c1=?' using 'select * from t where c1>=1';
+IJ WARNING: Autocommit may close using result set
+C1         
+-----------
+1          
+ij> drop table t;
+0 rows inserted/updated/deleted
+ij> -- show that long fields now don't take forever...
+create table t ( c char(50));
+0 rows inserted/updated/deleted
+ij> insert into t values('hello');
+1 row inserted/updated/deleted
+ij> select cast(c as varchar(20)) from t;
+1                   
+--------------------
+hello               
+ij> drop table t;
+0 rows inserted/updated/deleted
+ij> -- show multiconnect ability; db name is wombat, reuse it...
+-- assumes ij.protocol is appropriately set...
+connect 'wombat' as wombat;
+ij(WOMBAT)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+WOMBAT* - 	jdbc:derby:wombat
+* = current connection
+ij(WOMBAT)> set connection connection0;
+ij(CONNECTION0)> show connections;
+CONNECTION0* - 	jdbc:derby:wombat
+WOMBAT - 	jdbc:derby:wombat
+* = current connection
+ij(CONNECTION0)> set connection wombat;
+ij(WOMBAT)> disconnect;
+ij> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+No current connection
+ij> set connection connection0;
+ij> show connections;
+CONNECTION0* - 	jdbc:derby:wombat
+* = current connection
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij3.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,8 @@
+ij> -- this test shows that ij can detect the driver from the URL.
+-- the ij.properties file sets ij.database and nothing else.
+values 'PASS';
+1   
+----
+PASS
+ij> -- this test also exercises the shutdown on exit code
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij4.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij4.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij4.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,18 @@
+ij> connect 'jdbc:derby:wombat;create=true';
+ij> -- test maximum display width
+values cast('1' as varchar(512));
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+1                                                                                                                               
+ij> maximumdisplaywidth 40;
+ij> values cast('1' as varchar(512));
+1                                       
+----------------------------------------
+1                                       
+ij> maximumdisplaywidth 400;
+ij> values cast('1' as varchar(512));
+1                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1                                                                                                                                                                                                                                                                                                                                                                                                               
+ij> -- and, the exit command:
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij5.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+CONNONE* - 	jdbc:derby:wombat
+CONNTWO - 	jdbc:derby:lemming
+* = current connection
+ij(CONNONE)> -- assumes the connections connOne, connTwo are set up already
+-- 1)at the startup time, it will list all the connections
+-- 2)select will now display number of rows selected
+select count(*) from sys.systables where 1=0;
+1          
+-----------
+0          
+1 row selected
+ij(CONNONE)> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij6.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij6.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ij6.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+ij> -- 1)no  connections made so far at the startup time and hence no information about
+-- connections is displayed
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/ijConnName.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,42 @@
+ERROR XJ004: Database 'nevercreated' not found.
+ERROR 08001: No suitable driver
+ij(CONNONE)> -- assumes the connections connOne, connTwo are set up already
+-- and that connThree, connFour failed to be setup correctly (bad URLs)
+-- expect connOne to be active
+show connections;
+CONNONE* - 	jdbc:derby:wombat
+CONNTWO - 	jdbc:derby:lemming
+* = current connection
+ij(CONNONE)> set connection connOne;
+ij(CONNONE)> values 1;
+1          
+-----------
+1          
+ij(CONNONE)> set connection connTwo;
+ij(CONNTWO)> values 1;
+1          
+-----------
+1          
+ij(CONNTWO)> -- connThree doesn't exist, it failed at boot time
+set connection connThree;
+IJ ERROR: No connection exists with the name CONNTHREE
+ij(CONNTWO)> -- connFour doesn't exist, it failed at boot time
+set connection connFour;
+IJ ERROR: No connection exists with the name CONNFOUR
+ij(CONNTWO)> -- connTwo is still active
+show connections;
+CONNONE - 	jdbc:derby:wombat
+CONNTWO* - 	jdbc:derby:lemming
+* = current connection
+ij(CONNTWO)> -- no such connection to disconnect
+disconnect noName;
+IJ ERROR: No connection exists with the name NONAME
+ij(CONNTWO)> disconnect connOne;
+ij> -- connOne no longer exists
+set connection connOne;
+IJ ERROR: No connection exists with the name CONNONE
+ij> disconnect current;
+ij> -- see no more connections to use
+show connections;
+No connections available.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExport.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExport.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExport.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,25 @@
+Test importExport starting
+testing non-existing data file
+Data file not found: extinout/Z.dat
+testing null data file
+Data file can not be null.
+testing empty table
+testing empty table with Delimited format
+testing empty table import Field/Char Delimiters
+PASS: setup complete
+testing import/export with default options
+testing IE with code set 8859_1
+testing IE with delimiter and codeset
+testing IE with delimiters(%, &) and Cp1252
+testing IE with delimiters(%, &) and UTF-16
+testing IE with delimiters(^, #) and WRONG ENCODEINGH
+Got IOException while writing data to the file
+testing datatypes that does not have Export Supprt
+Column 'C1' in the table is of type BLOB, it is not supported by import/export.
+Column 'C1' in the table is of type BLOB, it is not supported by import/export.
+Read endOfFile at unexpected place on line 2
+PASS: finished testing import and export
+PASS: teardown complete
+PASS: finished cleaning up the temporary objects from database
+PASS
+Test importExport finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/importExportThruIJ.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,718 @@
+ij> -- test for import export thru command line interface
+-- first test basic import functionality
+-- ascii delimited default format
+drop table T1;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T1' because it does not exist.
+ij> create table T1 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company varchar(35),
+			Address varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+0 rows inserted/updated/deleted
+ij> create index T1_IndexBalance on T1 (Balance, Account, Company);
+0 rows inserted/updated/deleted
+ij> create index T1_IndexFname on T1 (Fname, Account);
+0 rows inserted/updated/deleted
+ij> create index T1_IndexLname on T1 (Lname, Account);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1' , 'extin/EndOfFile.txt' , 
+                                    null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: Read endOfFile at unexpected place on line 2' was thrown while evaluating an expression.
+ERROR XIE0E: Read endOfFile at unexpected place on line 2
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1' , 'extin/Tutor1.asc' , 
+                                    null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T1'));
+1          
+-----------
+1          
+ij> -- ascii Fixed
+drop table T2;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T2' because it does not exist.
+ij> autocommit off;
+ij> create table T2 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company	varchar(35),
+			Address	varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance	decimal(8,2));
+0 rows inserted/updated/deleted
+ij> create index T2_IndexBalance on T2 (Balance, Account, Company);
+0 rows inserted/updated/deleted
+ij> create index T2_IndexFname on T2 (Fname, Account);
+0 rows inserted/updated/deleted
+ij> create index T2_IndexLname on T2 (Lname, Account);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --this one should fail becuase this is not the right command to handle fixed formats
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T2' , 'extin/Tutor2.asc' , 
+                                    null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: Column 'COLUMN2' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'COLUMN2' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 42X04: Column 'COLUMN2' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'COLUMN2' is not a column in the target table.
+ij> values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T2'));
+1          
+-----------
+1          
+ij> commit;
+ij> -- test remapping
+drop table T3;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T3' because it does not exist.
+ij> create table T3 (	Lname	char(30),
+			Fname	char(30),
+			Account	int not null primary key,
+			Company varchar(35),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+0 rows inserted/updated/deleted
+ij> create index T3_indexBalance on T3 (Balance, Company, Account);
+0 rows inserted/updated/deleted
+ij> create index T3_indexPayment on T3 (Payment, Company, Account);
+0 rows inserted/updated/deleted
+ij> --icorrect mapping of file to table ; should give error and rollback
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'T3' , 
+                                  null , '3, 2, 1, 4, 9, 200' ,
+				  'extin/Tutor3.asc' , 
+				  null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: Column 'COLUMN200' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'COLUMN200' is not a column in the target table.' was thrown while evaluating an expression.
+ERROR 42X04: Column 'COLUMN200' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list.  If this is a CREATE or ALTER TABLE statement then 'COLUMN200' is not a column in the target table.
+ij> rollback;
+ij> -- table should not be there
+select count(*) from T3;
+ERROR 42X05: Table 'T3' does not exist.
+ij> create table T3 (	Lname	char(30),
+			Fname	char(30),
+			Account	int not null primary key,
+			Company varchar(35),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+0 rows inserted/updated/deleted
+ij> create index T3_indexBalance on T3 (Balance, Company, Account);
+0 rows inserted/updated/deleted
+ij> create index T3_indexPayment on T3 (Payment, Company, Account);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'T3' ,  
+                                  null , '3, 2, 1, 4, 9, 10' ,
+				  'extin/Tutor3.asc' ,
+				   null, null, null, 0) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T3'));
+1          
+-----------
+1          
+ij> -- now check results
+select count(*) from T1;
+1          
+-----------
+102        
+ij> select count(*) from T2;
+1          
+-----------
+0          
+ij> select count(*) from T3;
+1          
+-----------
+102        
+ij> select * from T1 where State = 'CA';
+ACCOUNT    |FNAME                         |LNAME                         |COMPANY                            |ADDRESS                                 |CITY                |STATE|ZIP       |PAYMENT    |BALANCE    
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+10000      |Bugs                          |Bunny                         |Warner Brothers                    |  -- Rabbit Hole --                     |Los Angeles         |CA   |94001     |0.00       |100.00     
+10129      |Mickey                        |Mouse                         |Disneyland                         |Magic Kingdom                           |Los Angeles         |CA   |94000     |0.00       |1.00       
+ij> select * from T2 where State = 'CA';
+ACCOUNT    |FNAME                         |LNAME                         |COMPANY                            |ADDRESS                                 |CITY                |STATE|ZIP       |PAYMENT    |BALANCE    
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> select * from T3 where Fname = 'Bugs' or Fname = 'Mickey';
+LNAME                         |FNAME                         |ACCOUNT    |COMPANY                            |PAYMENT    |BALANCE    
+-------------------------------------------------------------------------------------------------------------------------------------
+Bunny                         |Bugs                          |10000      |Warner Brothers                    |0.00       |10000.00   
+Mouse                         |Mickey                        |10129      |Disneyland                         |0.00       |3.00       
+ij> select Balance, Account, Company from T1 order by Balance;
+BALANCE    |ACCOUNT    |COMPANY                            
+-----------------------------------------------------------
+1.00       |10129      |Disneyland                         
+100.00     |10000      |Warner Brothers                    
+218.00     |10019      |Market Place                       
+222.00     |10023      |Madson & Huth Communication Co     
+223.00     |10024      |La Salle Clinic                    
+224.00     |10025      |Town & Country Electric Inc.       
+225.00     |10026      |Saturn of Appleton                 
+226.00     |10027      |Bemiss Corp.                       
+227.00     |10028      |AAL Member Credit Union            
+228.00     |10029      |Office Support                     
+229.00     |10030      |EAA                                
+230.00     |10031      |Kurz Electric                      
+231.00     |10032      |Alpha 1                            
+233.00     |10034      |Valley Trust Corporation           
+234.00     |10035      |Fox Community Credit Union         
+235.00     |10036      |Valley Lawn Care                   
+236.00     |10037      |Network Health Plan                
+237.00     |10038      |Kolosso Toyota                     
+238.00     |10039      |AAL                                
+239.00     |10040      |WDFF                               
+240.00     |10041      |AAL                                
+241.00     |10042      |Novus Health Group                 
+242.00     |10043      |AAL                                
+243.00     |10044      |AAL Capital Management             
+244.00     |10045      |AAL Printing/Distribution          
+245.00     |10046      |Lawrence University                
+246.00     |10047      |Ken Gibson Assoc.                  
+247.00     |10048      |Menasha Employees Credit Union     
+248.00     |10049      |UPIU                               
+249.00     |10050      |AAL                                
+251.00     |10052      |Fox Valley Technical College       
+252.00     |10053      |Bergstrom Air Force Base           
+253.00     |10054      |Bank One                           
+254.00     |10055      |Bergstrom Enterprises              
+255.00     |10056      |Fox Cities Bank                    
+256.00     |10057      |Town of Vandenbroek                
+257.00     |10058      |Kitz Printing                      
+259.00     |10060      |Prime Control Systems              
+260.00     |10061      |Van Vreede's                       
+261.00     |10062      |Insurance Brokerage Services       
+262.00     |10063      |Fox Valley Travel                  
+263.00     |10064      |M & M Advertising                  
+264.00     |10065      |University of Women                
+265.00     |10066      |YMCA                               
+266.00     |10067      |O'Donnell Publishing               
+267.00     |10068      |Western Ice                        
+268.00     |10069      |Four D Corporation                 
+269.00     |10070      |Andrews Mautner, Inc.              
+270.00     |10071      |Laser Typesetting                  
+271.00     |10072      |Wallach & Assoc.                   
+272.00     |10073      |Town of Grand River                
+273.00     |10074      |Cabelvision                        
+274.00     |10075      |Print & Mail, Inc.                 
+275.00     |10076      |Jewelers Mutual Insurance          
+276.00     |10077      |Burton Karstedt                    
+278.00     |10079      |Twin City Rod & Gun Club           
+279.00     |10080      |American Legion                    
+280.00     |10081      |TechLine                           
+281.00     |10082      |Data One Computer Service          
+282.00     |10083      |Appleton Area School District      
+283.00     |10084      |Banta Corporate                    
+284.00     |10085      |HRC Inc.                           
+285.00     |10086      |Phopar                             
+286.00     |10087      |Sutherland Electric                
+288.00     |10088      |Banta Credit Union                 
+289.00     |10089      |Uffenbeck Diamonds                 
+290.00     |10090      |Equitable Reserve Association      
+291.00     |10091      |Derksen Printing                   
+292.00     |10092      |Custom Printing                    
+293.00     |10093      |Faye's Fine Jewelry                
+294.00     |10094      |Haugners Inc.                      
+295.00     |10095      |Pyramid Marketing & Advertising    
+297.00     |10097      |Wisconsin Tissue Credit Union      
+298.00     |10098      |AAL                                
+299.00     |10099      |Pat Woods Inc                      
+301.00     |10100      |Creative Learning International    
+302.00     |10101      |United Health                      
+303.00     |10102      |Memorial Florists                  
+304.00     |10103      |Fay Hawkinson & Kruse Inc          
+305.00     |10104      |Enterprise Motors                  
+306.00     |10105      |Weidert Group Inc                  
+307.00     |10106      |Principal Financial                
+308.00     |10107      |Woodfield Suites                   
+309.00     |10108      |Master Litho                       
+310.00     |10109      |Rawhide Boys Ranch                 
+311.00     |10110      |Ad Works                           
+312.00     |10111      |Directions Inc                     
+313.00     |10112      |Counseling Resource Center         
+314.00     |10113      |World Wide Auto Parts              
+315.00     |10114      |Secura Insurance                   
+316.00     |10115      |Witthuhn Printing                  
+317.00     |10116      |St Mary's Central High School      
+319.00     |10117      |Valley Periodontics                
+320.00     |10118      |Neenah Printing                    
+321.00     |10119      |YMCA of Appleton                   
+322.00     |10120      |Appleton Medical Center            
+323.00     |10121      |Quinlan Dentistry                  
+324.00     |10122      |Klusendorf Chiropractic            
+325.00     |10123      |Drucks Plumbing                    
+326.00     |10124      |Market Link                        
+327.00     |10125      |Norandex                           
+328.00     |10126      |Appleton Camping                   
+ij> select Balance, Account, Company from T2 order by Balance;
+BALANCE    |ACCOUNT    |COMPANY                            
+-----------------------------------------------------------
+ij> select Balance, Account, Company from T3 order by Balance;
+BALANCE    |ACCOUNT    |COMPANY                            
+-----------------------------------------------------------
+3.00       |10129      |Disneyland                         
+218.00     |10019      |Market Place                       
+222.00     |10023      |Madson & Huth Communication Co     
+223.00     |10024      |La Salle Clinic                    
+224.00     |10025      |Town & Country Electric Inc.       
+225.00     |10026      |Saturn of Appleton                 
+226.00     |10027      |Bemiss Corp.                       
+227.00     |10028      |AAL Member Credit Union            
+228.00     |10029      |Office Support                     
+229.00     |10030      |EAA                                
+230.00     |10031      |Kurz Electric                      
+231.00     |10032      |Alpha 1                            
+233.00     |10034      |Valley Trust Corporation           
+234.00     |10035      |Fox Community Credit Union         
+235.00     |10036      |Valley Lawn Care                   
+236.00     |10037      |Network Health Plan                
+237.00     |10038      |Kolosso Toyota                     
+238.00     |10039      |AAL                                
+239.00     |10040      |WDFF                               
+240.00     |10041      |AAL                                
+241.00     |10042      |Novus Health Group                 
+242.00     |10043      |AAL                                
+243.00     |10044      |AAL Capital Management             
+244.00     |10045      |AAL Printing/Distribution          
+245.00     |10046      |Lawrence University                
+246.00     |10047      |Ken Gibson Assoc.                  
+247.00     |10048      |Menasha Employees Credit Union     
+248.00     |10049      |UPIU                               
+249.00     |10050      |AAL                                
+251.00     |10052      |Fox Valley Technical College       
+252.00     |10053      |Bergstrom Air Force Base           
+253.00     |10054      |Bank One                           
+254.00     |10055      |Bergstrom Enterprises              
+255.00     |10056      |Fox Cities Bank                    
+256.00     |10057      |Town of Vandenbroek                
+257.00     |10058      |Kitz Printing                      
+259.00     |10060      |Prime Control Systems              
+260.00     |10061      |Van Vreede's                       
+261.00     |10062      |Insurance Brokerage Services       
+262.00     |10063      |Fox Valley Travel                  
+263.00     |10064      |M & M Advertising                  
+264.00     |10065      |University of Women                
+265.00     |10066      |YMCA                               
+266.00     |10067      |O'Donnell Publishing               
+267.00     |10068      |Western Ice                        
+268.00     |10069      |Four D Corporation                 
+269.00     |10070      |Andrews Mautner, Inc.              
+270.00     |10071      |Laser Typesetting                  
+271.00     |10072      |Wallach & Assoc.                   
+272.00     |10073      |Town of Grand River                
+273.00     |10074      |Cabelvision                        
+274.00     |10075      |Print & Mail, Inc.                 
+275.00     |10076      |Jewelers Mutual Insurance          
+276.00     |10077      |Burton Karstedt                    
+278.00     |10079      |Twin City Rod & Gun Club           
+279.00     |10080      |American Legion                    
+280.00     |10081      |TechLine                           
+281.00     |10082      |Data One Computer Service          
+282.00     |10083      |Appleton Area School District      
+283.00     |10084      |Banta Corporate                    
+284.00     |10085      |HRC Inc.                           
+285.00     |10086      |Phopar                             
+286.00     |10087      |Sutherland Electric                
+288.00     |10088      |Banta Credit Union                 
+289.00     |10089      |Uffenbeck Diamonds                 
+290.00     |10090      |Equitable Reserve Association      
+291.00     |10091      |Derksen Printing                   
+292.00     |10092      |Custom Printing                    
+293.00     |10093      |Faye's Fine Jewelry                
+294.00     |10094      |Haugners Inc.                      
+295.00     |10095      |Pyramid Marketing & Advertising    
+297.00     |10097      |Wisconsin Tissue Credit Union      
+298.00     |10098      |AAL                                
+299.00     |10099      |Pat Woods Inc                      
+301.00     |10100      |Creative Learning International    
+302.00     |10101      |United Health                      
+303.00     |10102      |Memorial Florists                  
+304.00     |10103      |Fay Hawkinson & Kruse Inc          
+305.00     |10104      |Enterprise Motors                  
+306.00     |10105      |Weidert Group Inc                  
+307.00     |10106      |Principal Financial                
+308.00     |10107      |Woodfield Suites                   
+309.00     |10108      |Master Litho                       
+310.00     |10109      |Rawhide Boys Ranch                 
+311.00     |10110      |Ad Works                           
+312.00     |10111      |Directions Inc                     
+313.00     |10112      |Counseling Resource Center         
+314.00     |10113      |World Wide Auto Parts              
+315.00     |10114      |Secura Insurance                   
+316.00     |10115      |Witthuhn Printing                  
+317.00     |10116      |St Mary's Central High School      
+319.00     |10117      |Valley Periodontics                
+320.00     |10118      |Neenah Printing                    
+321.00     |10119      |YMCA of Appleton                   
+322.00     |10120      |Appleton Medical Center            
+323.00     |10121      |Quinlan Dentistry                  
+324.00     |10122      |Klusendorf Chiropractic            
+325.00     |10123      |Drucks Plumbing                    
+326.00     |10124      |Market Link                        
+327.00     |10125      |Norandex                           
+328.00     |10126      |Appleton Camping                   
+10000.00   |10000      |Warner Brothers                    
+ij> --- now check other input formats
+--- this is Tutor1 with RecordSeperator=',', FieldStartDelimiter=(, FieldEndDelimiter=),FieldSeperator=TAB
+autocommit on;
+ij> drop table Alt1;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'ALT1' because it does not exist.
+ij> create table Alt1 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company varchar(35),
+			Address varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'Alt1' , 'extin/Alt1.asc' , 
+                                      null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: Invalid character string format for type INTEGER.' was thrown while evaluating an expression.
+ERROR 22018: Invalid character string format for type INTEGER.
+ij> select * from Alt1 where State = 'CA';
+ACCOUNT    |FNAME                         |LNAME                         |COMPANY                            |ADDRESS                                 |CITY                |STATE|ZIP       |PAYMENT    |BALANCE    
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> select Balance, Account, Company from Alt1 order by Balance;
+BALANCE    |ACCOUNT    |COMPANY                            
+-----------------------------------------------------------
+ij> -- this is Tutor1 with some null fields
+drop table Alt3;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'ALT3' because it does not exist.
+ij> create table Alt3 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company varchar(35),
+			Address varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'Alt3' , 'extin/Alt3.asc' , 
+                                      null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: Invalid character string format for type INTEGER.' was thrown while evaluating an expression.
+ERROR 22018: Invalid character string format for type INTEGER.
+ij> select * from Alt3 where State = 'CA' or State = 'TX';
+ACCOUNT    |FNAME                         |LNAME                         |COMPANY                            |ADDRESS                                 |CITY                |STATE|ZIP       |PAYMENT    |BALANCE    
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> select Balance, Account, Company from Alt3 order by Balance;
+BALANCE    |ACCOUNT    |COMPANY                            
+-----------------------------------------------------------
+ij> -- test remapping
+-- test remapping
+-- following case is commented because data has different seperator than the default one 
+-- enable this case after rearranging the data (-suresht)
+--create table tempAlt3(column1 varchar(1000) , column3 varchar(1000) , column9 varchar(1000));
+--call SYSCS_UTIL.SYSCS_IMPORT_DATA (null, 'tempAlt3' , 
+--    				   null , '2,3,9',
+--				   'extin/Alt3.asc' , 
+--				   null, null, null, 0) ;
+--select * from tempAlt3;
+---
+---  SQL anywhere table
+---
+drop table sqlAnywhere1;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'SQLANYWHERE1' because it does not exist.
+ij> create table sqlAnywhere1 (
+	Id	int,
+	Name	varchar(40),
+	Title	varchar(40),
+	Company	varchar(50),
+	Address	varchar(80),
+	City	varchar(30),
+	State	varchar(30),
+	Zip	varchar(30),
+	Country varchar(30),
+	phone1	varchar(50),
+	phone2	varchar(30),
+	email	varchar(80),
+	web	varchar(50));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'sqlAnywhere1' ,
+                                  null , '1,2,3,4,5,7,8,9,10,11,12,13,14', 
+	 		          'extin/sqlAnywhere1.txt' , 
+				  '|', '''', 'ASCII', 0) ;
+0 rows inserted/updated/deleted
+ij> select Company, Country from sqlAnywhere1 where country not like 'U%S%A%' and country is not null;
+COMPANY                                           |COUNTRY                       
+---------------------------------------------------------------------------------
+Dow Jones Interactive Publishing                  |                              
+Electric Press                                    |                              
+Los Alamos National Lab                           |                              
+SoftCom                                           |                              
+Kinetoscope                                       |                              
+Npulse Software                                   |                              
+Penetics                                          |                              
+Columbia University                               |                              
+Visionary Information Systems, Inc.               |                              
+Micro Computer Systems                            |                              
+Gemini Systems                                    |                              
+Crossroads Technologies                           |                              
+Silverstream Software, Inc.                       |                              
+Rexton Interactive                                |                              
+Tilden Park                                       |                              
+Blue Lobster Software                             |                              
+Novera                                            |                              
+Verix Software                                    |                              
+Lotus                                             |                              
+Background Profiles                               |                              
+Weblogic                                          |                              
+Marimba                                           |                              
+MECA Software                                     |                              
+Pervasive Software, Inc.                          |                              
+Neuron Data                                       |                              
+Tandem                                            |                              
+Verge Software Corporation                        |                              
+Computer Curriculum Corporation                   |                              
+Omix                                              |                              
+Noblestar                                         |                              
+Highmark, Inc.                                    |                              
+Learncom                                          |                              
+Molecular Simulations                             |                              
+Progress Software                                 |                              
+Skunk Technologies                                |                              
+Sterling Software                                 |                              
+Sun Microsystems                                  |                              
+Thought, Inc.                                     |                              
+Internet Image                                    |                              
+Database Advisor Magazine                         |                              
+Rogue Wave                                        |                              
+Creative Concepts Corporation                     |                              
+Visa International                                |                              
+Object Systems, Inc.                              |                              
+Dynavent Software                                 |                              
+Telecallaction                                    |                              
+Cybered Corp                                      |                              
+ADC Kentrox                                       |                              
+Sprocket Interactive Solutions                    |                              
+Kenetiks, Inc.                                    |                              
+Infospace, Inc.                                   |                              
+Open Horizon                                      |                              
+WebMethods, Inc.                                  |                              
+Sovereign Bank                                    |                              
+NetNumina Solutions                               |                              
+Interactive Education                             |                              
+LiveMedia                                         |                              
+Sun Microsystems                                  |                              
+Grandview DB/DC Systems                           |                              
+Mage Lang Institute, Ltd.                         |                              
+List Foundation                                   |                              
+Shafir Inc.                                       |                              
+Great Northwest Design                            |                              
+Inovie Software Inc.                              |                              
+LANQUEST                                          |                              
+Sprint Paranet                                    |                              
+Orbital Technologies                              |                              
+Biss GmbH                                         |                              
+GRC International, Inc.                           |                              
+Painted Word, Inc.                                |                              
+Isadra, Inc.                                      |                              
+Delphi Solutions                                  |Switzerland                   
+FieldWorker Products Ltd.                         |                              
+Fiberlane Communications Canada, Inc.             |CANADA                        
+Novell                                            |                              
+Platinum technology, Inc. ViaTech Development Lab |                              
+IBM                                               |Switzerland                   
+Manna Network Technologies                        |Israel                        
+Advanced Workstation Solutions, Inc.              |                              
+Cybotics Technologies Ltd.                        |Hong Kong                     
+Intermedia Communications, Inc.                   |                              
+Bay Networks, Inc.                                |                              
+Charles River Associates, Inc.                    |                              
+Scopus Technologies                               |                              
+Net Dynamics                                      |US                            
+Tomday                                            |US                            
+Cerulean Technology, Inc.                         |                              
+Pencom Web Works                                  |                              
+Check Free                                        |                              
+Cybered Corp.                                     |                              
+The Weizmann Institute of Science                 |Israel                        
+Tridium, Inc.                                     |                              
+Omron Corporation                                 |Japan                         
+Nob Systems Corp.                                 |                              
+Software Tecnologia Y Servicios S.A.              |Colombia                      
+IBM                                               |                              
+Gunn Software Pty Ltd.                            |Australia                     
+en Vise Corporation                               |Canada                        
+University of Maryland, UMBC                      |US                            
+Temple Games, Inc.                                |US                            
+Food and Agriculture Organization                 |Italy                         
+Adobe Systems                                     |US                            
+Trefoil Computers Ltd                             |UK                            
+University of Economics                           |AT                            
+Acriter Systems BV                                |Netherlands                   
+NetBeans, Inc.                                    |                              
+Sundayta Ltd                                      |United Kingdom                
+Synthese S.A.                                     |                              
+ij> drop table sqlAnywhere2;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'SQLANYWHERE2' because it does not exist.
+ij> create table sqlAnywhere2 (
+	Fname varchar(30),
+	Lname varchar(30),
+	email varchar(40),
+	phone varchar(30));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'sqlAnywhere2' , 
+		                  null , '3, 4, 7, 5',
+			          'extin/sqlAnywhere2.txt' , 
+				  '|', '''', 'ASCII', 0) ;
+0 rows inserted/updated/deleted
+ij> select count(*) from sqlAnywhere2;
+1          
+-----------
+204        
+ij> ---
+---  MS access text file
+---  default text format is compatible with ours except their record seperator
+---  is CR-LF instead of LF
+--   data does not seem to match above description , only problem I see
+---  is delimiters inside the data , which gets fixed with double delimters
+---  check the intended case -suresht
+drop table HouseHoldItem;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'HOUSEHOLDITEM' because it does not exist.
+ij> create table HouseHoldItem (
+	Category	int,
+	RoomId		int,
+	Description	varchar(255),
+	Model		varchar(50),
+	ModelId		varchar(50),
+	SerialNumber	varchar(50),
+	DayPurchase	date,
+	PurchasePrice	decimal(8,2),
+	Insured		smallint,
+	Note		varchar(512));
+0 rows inserted/updated/deleted
+ij> -- import it first with just LF as record seperator, we should be seeing 
+-- ^M's at the end of note field.
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'HouseHoldItem' , 
+				  null , '2,3,4,5,6,7,8,11,14', 
+				  'extin/Access1.txt' , 
+				  null, null, null, 0) ;
+ERROR 38000: The exception 'SQL Exception: The number of values assigned is not the same as the number of specified or implied columns.' was thrown while evaluating an expression.
+ERROR 42802: The number of values assigned is not the same as the number of specified or implied columns.
+ij> select * from HouseHoldItem;
+CATEGORY   |ROOMID     |DESCRIPTION                                                                                                                     |MODEL                                             |MODELID                                           |SERIALNUMBER                                      |DAYPURCHA&|PURCHASEPR&|INSUR&|NOTE                                                                                                                            
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> ----
+---- test export 
+----
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'T1' , 'extinout/t1.dump' , 
+                                    '|','''', 'ASCII') ;
+0 rows inserted/updated/deleted
+ij> create table  imp_temp(column2 varchar(200), 
+                  column3 varchar(200), 
+                  column4 varchar(200), 
+                  column5 varchar(200),
+                  column6 varchar(200));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_temp' ,null, '2, 3, 4, 5, 6',
+                                    'extinout/t1.dump', '|', '''', 'ASCII', 0) ;
+0 rows inserted/updated/deleted
+ij> select * from imp_temp ;
+COLUMN2                                                                                                                         |COLUMN3                                                                                                                         |COLUMN4                                                                                                                         |COLUMN5                                                                                                                         |COLUMN6                                                                                                                         
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Bugs                                                                                                                            |Bunny                                                                                                                           |Warner Brothers                                                                                                                 |  -- Rabbit Hole --                                                                                                             |Los Angeles                                                                                                                     
+Bobbi                                                                                                                           |Arndt                                                                                                                           |Market Place                                                                                                                    |1000 S Nicolet Rd                                                                                                               |Sametown                                                                                                                        
+Bruce                                                                                                                           |Beecher                                                                                                                         |Madson & Huth Communication Co                                                                                                  |1037 W Wisconsin Ave                                                                                                            |Smithville                                                                                                                      
+Bruce                                                                                                                           |Beyer                                                                                                                           |La Salle Clinic                                                                                                                 |108 E Wisconsin Ave                                                                                                             |Jonestown                                                                                                                       
+Butch                                                                                                                           |Bobbi                                                                                                                           |Town & Country Electric Inc.                                                                                                    |108 Hillock Ct                                                                                                                  |Smithville                                                                                                                      
+Calla                                                                                                                           |Boshers                                                                                                                         |Saturn of Appleton                                                                                                              |110 Fox River Dr                                                                                                                |Smithville                                                                                                                      
+Carol                                                                                                                           |Brauer                                                                                                                          |Bemiss Corp.                                                                                                                    |110 W North Water St                                                                                                            |Jonestown                                                                                                                       
+Carol                                                                                                                           |Braun                                                                                                                           |AAL Member Credit Union                                                                                                         |1115 E Glendale Ave                                                                                                             |Smithville                                                                                                                      
+Cheri                                                                                                                           |Buksyk                                                                                                                          |Office Support                                                                                                                  |1122 Milwaukee St                                                                                                               |Jonestown                                                                                                                       
+Chuck                                                                                                                           |Buss                                                                                                                            |EAA                                                                                                                             |1134 S Franklin St                                                                                                              |Overton                                                                                                                         
+Chuck                                                                                                                           |Carpenter                                                                                                                       |Kurz Electric                                                                                                                   |115 S Drew St                                                                                                                   |Smithville                                                                                                                      
+Chuck                                                                                                                           |Carr                                                                                                                            |Alpha 1                                                                                                                         |1151 Valley Fair Mall                                                                                                           |Jonestown                                                                                                                       
+Colleen                                                                                                                         |Casperson                                                                                                                       |Valley Trust Corporation                                                                                                        |120 N Morrison St                                                                                                               |Smithville                                                                                                                      
+Connie                                                                                                                          |Catterton                                                                                                                       |Fox Community Credit Union                                                                                                      |1200 N Perkins St                                                                                                               |Smithville                                                                                                                      
+Connie                                                                                                                          |Clay                                                                                                                            |Valley Lawn Care                                                                                                                |121 N Douglas St # R                                                                                                            |Smithville                                                                                                                      
+Craig                                                                                                                           |Collar                                                                                                                          |Network Health Plan                                                                                                             |1216 W Wisconsin Ave                                                                                                            |Moretown                                                                                                                        
+Dan                                                                                                                             |Coppenger                                                                                                                       |Kolosso Toyota                                                                                                                  |1221 N Lawe St                                                                                                                  |Smithville                                                                                                                      
+Dan                                                                                                                             |Dag                                                                                                                             |AAL                                                                                                                             |1222 N Superior St                                                                                                              |Smithville                                                                                                                      
+Darlene                                                                                                                         |Dantzier                                                                                                                        |WDFF                                                                                                                            |124 W Wisconsin Ave                                                                                                             |Dime Box                                                                                                                        
+Darlene                                                                                                                         |Dellenmann                                                                                                                      |AAL                                                                                                                             |130 E Franklin St                                                                                                               |Smithville                                                                                                                      
+Darren                                                                                                                          |Dinkl                                                                                                                           |Novus Health Group                                                                                                              |1300 E Calumet St                                                                                                               |Smithville                                                                                                                      
+David                                                                                                                           |Dockry                                                                                                                          |AAL                                                                                                                             |1302 S Ritger                                                                                                                   |Smithville                                                                                                                      
+Debra                                                                                                                           |Dorsey                                                                                                                          |AAL Capital Management                                                                                                          |1320 S Lincoln St                                                                                                               |Smithville                                                                                                                      
+Denise                                                                                                                          |Richardson                                                                                                                      |AAL Printing/Distribution                                                                                                       |1396 Ridgeway Court                                                                                                             |Smithville                                                                                                                      
+Diane                                                                                                                           |Duginski                                                                                                                        |Lawrence University                                                                                                             |144 N Mall Dr                                                                                                                   |Smithville                                                                                                                      
+Dick                                                                                                                            |Dunbar                                                                                                                          |Ken Gibson Assoc.                                                                                                               |1461 Ashland Ave                                                                                                                |Smithville                                                                                                                      
+Dinah                                                                                                                           |Duxbury                                                                                                                         |Menasha Employees Credit Union                                                                                                  |1486 Earl St                                                                                                                    |Dime Box                                                                                                                        
+Dominic                                                                                                                         |Earl                                                                                                                            |UPIU                                                                                                                            |150 W Green Bay Rd                                                                                                              |Lonesome                                                                                                                        
+Don                                                                                                                             |Ely                                                                                                                             |AAL                                                                                                                             |1620 S Lawe St                                                                                                                  |Smithville                                                                                                                      
+Donna                                                                                                                           |Erdmann                                                                                                                         |Fox Valley Technical College                                                                                                    |1737 W Reid Dr                                                                                                                  |Smithville                                                                                                                      
+Donna                                                                                                                           |Esser                                                                                                                           |Bergstrom Air Force Base                                                                                                        |1801 N Richmond St # 12                                                                                                         |Jonestown                                                                                                                       
+Duane                                                                                                                           |Feavel                                                                                                                          |Bank One                                                                                                                        |1818 N Meade St                                                                                                                 |Smithville                                                                                                                      
+Emmett                                                                                                                          |Forseth                                                                                                                         |Bergstrom Enterprises                                                                                                           |1818 N Meade St                                                                                                                 |Smithville                                                                                                                      
+Erik                                                                                                                            |Francken                                                                                                                        |Fox Cities Bank                                                                                                                 |1825 N Bluemound Dr                                                                                                             |Jonestown                                                                                                                       
+Father                                                                                                                          |Freitas                                                                                                                         |Town of Vandenbroek                                                                                                             |1825 N Bluemound Dr                                                                                                             |Smithville                                                                                                                      
+Gary                                                                                                                            |Garvey                                                                                                                          |Kitz Printing                                                                                                                   |1909 W 2nd St                                                                                                                   |Overton                                                                                                                         
+George                                                                                                                          |Gibson                                                                                                                          |Prime Control Systems                                                                                                           |1965 Oshkosh Ave                                                                                                                |Smithville                                                                                                                      
+Glenn                                                                                                                           |Gorman                                                                                                                          |Van Vreede's                                                                                                                    |1990 S Van Dyke Rd                                                                                                              |Little Gorge                                                                                                                    
+Howard                                                                                                                          |Grennon                                                                                                                         |Insurance Brokerage Services                                                                                                    |200 W College Ave                                                                                                               |Smithville                                                                                                                      
+Ingrid                                                                                                                          |Guyette                                                                                                                         |Fox Valley Travel                                                                                                               |2074 American Dr                                                                                                                |Overton                                                                                                                         
+Jacquie                                                                                                                         |Hagen                                                                                                                           |M & M Advertising                                                                                                               |21 Waugoo Ave                                                                                                                   |Smithville                                                                                                                      
+James                                                                                                                           |Hammer                                                                                                                          |University of Women                                                                                                             |212 E College Ave                                                                                                               |Overton                                                                                                                         
+Jan                                                                                                                             |Hanks                                                                                                                           |YMCA                                                                                                                            |213 Paul Dr                                                                                                                     |Jonestown                                                                                                                       
+Jane                                                                                                                            |Haugner                                                                                                                         |O'Donnell Publishing                                                                                                            |217 Pacific St                                                                                                                  |Jonestown                                                                                                                       
+Jeff                                                                                                                            |Henneman                                                                                                                        |Western Ice                                                                                                                     |218 E Lawrence St                                                                                                               |Smithville                                                                                                                      
+Jeff                                                                                                                            |Holland                                                                                                                         |Four D Corporation                                                                                                              |2181 W Wisconsin Ave                                                                                                            |Appleton                                                                                                                        
+Jim                                                                                                                             |Hoppe                                                                                                                           |Andrews Mautner, Inc.                                                                                                           |221 E Atlantic St                                                                                                               |Moosetown                                                                                                                       
+Jim                                                                                                                             |Howard                                                                                                                          |Laser Typesetting                                                                                                               |221 W College Ave                                                                                                               |Smithville                                                                                                                      
+Jim                                                                                                                             |Ick                                                                                                                             |Wallach & Assoc.                                                                                                                |222 E College Ave                                                                                                               |Smithville                                                                                                                      
+Jim                                                                                                                             |Issacson                                                                                                                        |Town of Grand River                                                                                                             |222 E College Ave                                                                                                               |Smithville                                                                                                                      
+Jo Ann                                                                                                                          |Jahnke                                                                                                                          |Cabelvision                                                                                                                     |225 Main St Box # 8003                                                                                                          |Smithville                                                                                                                      
+Joanne                                                                                                                          |Jensen                                                                                                                          |Print & Mail, Inc.                                                                                                              |2301 W Nordale Dr                                                                                                               |Smithville                                                                                                                      
+Jodi                                                                                                                            |Jesse                                                                                                                           |Jewelers Mutual Insurance                                                                                                       |231 E College Ave                                                                                                               |Jonestown                                                                                                                       
+Joe                                                                                                                             |Jirtle                                                                                                                          |Burton Karstedt                                                                                                                 |2320 S Memorial Dr                                                                                                              |Dime Box                                                                                                                        
+John                                                                                                                            |Johnson                                                                                                                         |Twin City Rod & Gun Club                                                                                                        |250 Industrial Drive                                                                                                            |Jonestown                                                                                                                       
+John                                                                                                                            |Kamp                                                                                                                            |American Legion                                                                                                                 |2600 Stewart Ave # 22                                                                                                           |Smithville                                                                                                                      
+John                                                                                                                            |Karstedt                                                                                                                        |TechLine                                                                                                                        |2662 American Dr                                                                                                                |Smithville                                                                                                                      
+John                                                                                                                            |Kitz                                                                                                                            |Data One Computer Service                                                                                                       |2820 N Roemer Rd                                                                                                                |Smithville                                                                                                                      
+John                                                                                                                            |Kolberg                                                                                                                         |Appleton Area School District                                                                                                   |292 Ohio St                                                                                                                     |Smithville                                                                                                                      
+John                                                                                                                            |Korth                                                                                                                           |Banta Corporate                                                                                                                 |3000 W Wisconsin Ave                                                                                                            |Dime Box                                                                                                                        
+John                                                                                                                            |Kotarek                                                                                                                         |HRC Inc.                                                                                                                        |3012 Greenview Dr                                                                                                               |Jonestown                                                                                                                       
+Joyce                                                                                                                           |Kretsch                                                                                                                         |Phopar                                                                                                                          |3036 W Wisconsin Ave                                                                                                            |Smithville                                                                                                                      
+Judy                                                                                                                            |Kuehl                                                                                                                           |Sutherland Electric                                                                                                             |3090 Oregon St                                                                                                                  |Smithville                                                                                                                      
+Katie                                                                                                                           |Kusserow                                                                                                                        |Banta Credit Union                                                                                                              |310 Appleton St                                                                                                                 |Dime Box                                                                                                                        
+Kay                                                                                                                             |Lambert                                                                                                                         |Uffenbeck Diamonds                                                                                                              |319 Main St                                                                                                                     |Smithville                                                                                                                      
+Ken                                                                                                                             |Lamb                                                                                                                            |Equitable Reserve Association                                                                                                   |32122 Paseo Adelanto Ste 2B                                                                                                     |Jonestown                                                                                                                       
+Kevin                                                                                                                           |Lensby                                                                                                                          |Derksen Printing                                                                                                                |3218 Timothy Ln #6                                                                                                              |Overton                                                                                                                         
+Larry                                                                                                                           |Lesperance                                                                                                                      |Custom Printing                                                                                                                 |322 N Commercial St                                                                                                             |Smithville                                                                                                                      
+Larry                                                                                                                           |Lindberg                                                                                                                        |Faye's Fine Jewelry                                                                                                             |3232 N Ballard Rd                                                                                                               |Jonestown                                                                                                                       
+Linda                                                                                                                           |Linonofski                                                                                                                      |Haugners Inc.                                                                                                                   |33 Park Pl                                                                                                                      |Smithville                                                                                                                      
+Linda                                                                                                                           |Long                                                                                                                            |Pyramid Marketing & Advertising                                                                                                 |3301 W Prospect Ave                                                                                                             |Smithville                                                                                                                      
+Liz                                                                                                                             |Lonsway                                                                                                                         |Wisconsin Tissue Credit Union                                                                                                   |333 W College Ave                                                                                                               |Jonestown                                                                                                                       
+Lon                                                                                                                             |Lowe                                                                                                                            |AAL                                                                                                                             |342 W Wisconsin Ave                                                                                                             |Smithville                                                                                                                      
+Lori                                                                                                                            |Ludwig                                                                                                                          |Pat Woods Inc                                                                                                                   |3730 W College Ave                                                                                                              |Kimbro                                                                                                                          
+Luke                                                                                                                            |Madison                                                                                                                         |Creative Learning International                                                                                                 |375 Byrd Ave                                                                                                                    |Jonestown                                                                                                                       
+Mark                                                                                                                            |Mancl                                                                                                                           |United Health                                                                                                                   |3992 N Richmond St                                                                                                              |Smithville                                                                                                                      
+Mark                                                                                                                            |Melissa                                                                                                                         |Memorial Florists                                                                                                               |408 W Wisconsin Ave                                                                                                             |Smithville                                                                                                                      
+Marlene                                                                                                                         |Mentink                                                                                                                         |Fay Hawkinson & Kruse Inc                                                                                                       |411 Lincoln St                                                                                                                  |Overton                                                                                                                         
+Marti                                                                                                                           |Merryfield                                                                                                                      |Enterprise Motors                                                                                                               |419 N Oneida St                                                                                                                 |Smithville                                                                                                                      
+Marty                                                                                                                           |Meyere                                                                                                                          |Weidert Group Inc                                                                                                               |420 E Longville Dr                                                                                                              |Smithville                                                                                                                      
+Mary                                                                                                                            |Micke                                                                                                                           |Principal Financial                                                                                                             |4301 W Wisconsin Ave                                                                                                            |Smithville                                                                                                                      
+Mary                                                                                                                            |Mohr                                                                                                                            |Woodfield Suites                                                                                                                |4321 N Ballard Rd                                                                                                               |Smithville                                                                                                                      
+Mary                                                                                                                            |Mortensen                                                                                                                       |Master Litho                                                                                                                    |4321 N Ballard Rd                                                                                                               |Jonestown                                                                                                                       
+Mary                                                                                                                            |Mueller                                                                                                                         |Rawhide Boys Ranch                                                                                                              |4321 N Ballard Rd                                                                                                               |New Hope                                                                                                                        
+Mary                                                                                                                            |Mugerauer                                                                                                                       |Ad Works                                                                                                                        |4321 N Ballard Rd                                                                                                               |Smithville                                                                                                                      
+Mary                                                                                                                            |Novak                                                                                                                           |Directions Inc                                                                                                                  |4321 N Ballard Rd                                                                                                               |Jonestown                                                                                                                       
+Mary Beth                                                                                                                       |O'Donnell                                                                                                                       |Counseling Resource Center                                                                                                      |4321 N Ballard Rd                                                                                                               |Smithville                                                                                                                      
+Mary                                                                                                                            |Pannabaker                                                                                                                      |World Wide Auto Parts                                                                                                           |4321 W College Ave                                                                                                              |Smithville                                                                                                                      
+Michelle                                                                                                                        |Pawlowski                                                                                                                       |Secura Insurance                                                                                                                |4406 W Spencer St                                                                                                               |Smithville                                                                                                                      
+Mike                                                                                                                            |Peter                                                                                                                           |Witthuhn Printing                                                                                                               |4895 Integrity Way                                                                                                              |Smithville                                                                                                                      
+Mike                                                                                                                            |Peters                                                                                                                          |St Mary's Central High School                                                                                                   |502 W Northland Ave                                                                                                             |Dime Box                                                                                                                        
+Mike                                                                                                                            |Phillips                                                                                                                        |Valley Periodontics                                                                                                             |517 N Appleton St                                                                                                               |Smithville                                                                                                                      
+Nancy                                                                                                                           |Rapp                                                                                                                            |Neenah Printing                                                                                                                 |520 E Wisconsin Ave                                                                                                             |Jonestown                                                                                                                       
+Nancy                                                                                                                           |Rasmussen                                                                                                                       |YMCA of Appleton                                                                                                                |520 E Wisconsin Ave                                                                                                             |Smithville                                                                                                                      
+Nancy                                                                                                                           |Rathman                                                                                                                         |Appleton Medical Center                                                                                                         |525 Enterprise Dr                                                                                                               |Smithville                                                                                                                      
+Nancy                                                                                                                           |Reinl                                                                                                                           |Quinlan Dentistry                                                                                                               |525 N Perkins St                                                                                                                |Smithville                                                                                                                      
+Natalie                                                                                                                         |Reynolds                                                                                                                        |Klusendorf Chiropractic                                                                                                         |528 2nd St                                                                                                                      |Smithville                                                                                                                      
+Pam                                                                                                                             |Richeson                                                                                                                        |Drucks Plumbing                                                                                                                 |531 N Main St                                                                                                                   |Dime Box                                                                                                                        
+Pat                                                                                                                             |Robbins                                                                                                                         |Market Link                                                                                                                     |557 S Marcella St                                                                                                               |Smithville                                                                                                                      
+Pat                                                                                                                             |Roberts                                                                                                                         |Norandex                                                                                                                        |610 E Wisconsin Ave                                                                                                             |Smithville                                                                                                                      
+Peg                                                                                                                             |Russel                                                                                                                          |Appleton Camping                                                                                                                |675 Brighton Beach Rd                                                                                                           |Smithville                                                                                                                      
+Mickey                                                                                                                          |Mouse                                                                                                                           |Disneyland                                                                                                                      |Magic Kingdom                                                                                                                   |Los Angeles                                                                                                                     
+ij> drop table imp_temp;
+0 rows inserted/updated/deleted
+ij> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/inbetween.out	Tue Jan 11 11:53:57 2005
@@ -8,7 +8,7 @@
 set isolation to rr;
 0 rows inserted/updated/deleted
 ij> CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> autocommit off;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,90 @@
+ij> -- this test shows the ij commands in use,
+-- and what happens when invalid stuff is entered.
+-- no driver loaded yet, detected off of the url
+-- this one is a bad url:
+connect 'cloudscape:wombat';
+ERROR 08001: Driver not found: cloudscape:wombat
+ij> -- this one will work.
+connect 'jdbc:derby:wombat';
+ERROR XJ004: Database 'wombat' not found.
+ij> -- no connection yet, this will fail
+create table t (i int);
+IJ ERROR: Unable to establish connection
+ij> -- no table yet, this will fail
+select i from t;
+IJ ERROR: Unable to establish connection
+ij> -- invalid syntax ... incomplete statements
+driver;
+IJ ERROR: Unable to establish connection
+ij> connect;
+IJ ERROR: Unable to establish connection
+ij> prepare;
+IJ ERROR: Unable to establish connection
+ij> execute;
+IJ ERROR: Unable to establish connection
+ij> run;
+IJ ERROR: Unable to establish connection
+ij> remove;
+IJ ERROR: Unable to establish connection
+ij> -- should fail because procedure is an illegal statement name
+prepare procedure as 'select * from bar';
+IJ ERROR: procedure is an illegal name for a statement
+ij> -- should fail because text is passed on to cloudscape, which
+-- barfs on the unknown statement name. execute procedure is
+-- a foundation 2000 concept
+execute procedure sqlj.install_jar( 'file:c:/p4c/systest/out/DigIt.jar', 'SourceWUs', 1 );
+IJ ERROR: Unable to establish connection
+ij> -- and, the help output:
+help;
+ Supported commands include:
+  PROTOCOL 'JDBC protocol' [ AS ident ];
+                               -- sets a default or named protocol
+  DRIVER 'class for driver';   -- loads the named class
+  CONNECT 'url for database' [ PROTOCOL namedProtocol ] [ AS connectionName ];
+                               -- connects to database URL
+                               -- and may assign identifier
+  SET CONNECTION connectionName; -- switches to the specified connection
+  SHOW CONNECTIONS;            -- lists all connections
+  AUTOCOMMIT [ ON | OFF ];     -- sets autocommit mode for the connection
+  DISCONNECT [ CURRENT | connectionName | ALL ];
+                               -- drop current, named, or all connections;
+                               -- the default is CURRENT
+  COMMIT;                      -- commits the current transaction
+  ROLLBACK;                    -- rolls back the current transaction
+  PREPARE name AS 'SQL-J text'; -- prepares the SQL-J text
+  EXECUTE { name | 'SQL-J text' } [ USING { name | 'SQL-J text' } ] ;
+                               -- executes the statement with parameter
+                               -- values from the USING result set row
+  REMOVE name;                 -- removes the named previously prepared statement
+  RUN 'filename';              -- run commands from the named file
+  ELAPSEDTIME [ ON | OFF ];    -- sets elapsed time mode for ij
+  MAXIMUMDISPLAYWIDTH integerValue;
+                               -- sets the maximum display width for
+                               -- each column to integerValue
+  ASYNC name 'SQL-J text';     -- run the command in another thread
+  WAIT FOR name;               -- wait for result of ASYNC'd command
+  GET [SCROLL INSENSITIVE] CURSOR name AS 'SQL-J query';
+                               -- gets a cursor (JDBC result set) on the query
+                               -- SCROLL cursors are only available 
+                               -- in JDBC 2.0 and higher. 
+                               -- (Cursor scroll type is ignored in JDBC 1.X.) 
+  NEXT name;                   -- gets the next row from the named cursor
+  FIRST name;                  -- gets the first row from the named scroll cursor
+  LAST name;                   -- gets the last row from the named scroll cursor
+  PREVIOUS name;               -- gets the previous row from the named scroll cursor
+  ABSOLUTE integer name;       -- positions the named scroll cursor at the absolute row number
+                               -- (A negative number denotes position from the last row.) 
+  RELATIVE integer name;       -- positions the named scroll cursor relative to the current row
+                               -- (integer is number of rows)
+  AFTER LAST name;             -- positions the named scroll cursor after the last row
+  BEFORE FIRST name;           -- positions the named scroll cursor before the first row
+  GETCURRENTROWNUMBER name;    -- returns the row number for the current position of the named scroll cursor
+                               -- (0 is returned when the cursor is not positioned on a row.) 
+  CLOSE name;                  -- closes the named cursor
+  UNICODEESCAPE [ ON | OFF ]; -- sets unicode escape mode for the input stream
+  LOCALIZEDDISPLAY [ ON | OFF ];
+                               -- controls locale sensitive data representation
+  EXIT;                        -- exits ij
+  HELP;                        -- shows this message
+ Any unrecognized commands are treated as potential SQL-J commands and executed directly.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij5.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij5.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ij5.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+CONNONE - 	jdbc:derby:wombat
+CONNTWO* - 	jdbc:derby:lemming
+* = current connection
+ij(CONNTWO)> -- assumes the connections connOne, connTwo are set up already
+-- 1)at the startup time, it will list all the connections
+-- 2)select will now display number of rows selected
+select count(*) from sys.systables where 1=0;
+1          
+-----------
+0          
+1 row selected
+ij(CONNTWO)> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ijConnName.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ijConnName.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_13/ijConnName.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,42 @@
+ERROR 08001: Driver not found: jdbc:noone:fruitfly;create=true
+ERROR XJ004: Database 'nevercreated' not found.
+ij(CONNTWO)> -- assumes the connections connOne, connTwo are set up already
+-- and that connThree, connFour failed to be setup correctly (bad URLs)
+-- expect connOne to be active
+show connections;
+CONNONE - 	jdbc:derby:wombat
+CONNTWO* - 	jdbc:derby:lemming
+* = current connection
+ij(CONNTWO)> set connection connOne;
+ij(CONNONE)> values 1;
+1          
+-----------
+1          
+ij(CONNONE)> set connection connTwo;
+ij(CONNTWO)> values 1;
+1          
+-----------
+1          
+ij(CONNTWO)> -- connThree doesn't exist, it failed at boot time
+set connection connThree;
+IJ ERROR: No connection exists with the name CONNTHREE
+ij(CONNTWO)> -- connFour doesn't exist, it failed at boot time
+set connection connFour;
+IJ ERROR: No connection exists with the name CONNFOUR
+ij(CONNTWO)> -- connTwo is still active
+show connections;
+CONNONE - 	jdbc:derby:wombat
+CONNTWO* - 	jdbc:derby:lemming
+* = current connection
+ij(CONNTWO)> -- no such connection to disconnect
+disconnect noName;
+IJ ERROR: No connection exists with the name NONAME
+ij(CONNTWO)> disconnect connOne;
+ij> -- connOne no longer exists
+set connection connOne;
+IJ ERROR: No connection exists with the name CONNONE
+ij> disconnect current;
+ij> -- see no more connections to use
+show connections;
+No connections available.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxfieldsize.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxfieldsize.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/maxfieldsize.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,881 @@
+Test MaxFieldSize  starting
+Iteration #: 0
+Max Field Size = 0
+Column #: 1
+getObject(1)
+  as byte[] length 100
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getObject(2)
+  as byte[] length 43
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getObject(3)
+  as byte[] length 43
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+getObject(4)
+  as String
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+Column #: 5
+getObject(5)
+  as String
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+getObject(6)
+  as String
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 1
+Max Field Size = 0
+Column #: 1
+getString(1) length 200
+43315858585858585858585858585858585858585858585858585858585858585858585858585858585858202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020
+Column #: 2
+getString(2) length 86
+43325858585858585858585858585858585858585858585858585858585858585858585858585858585858
+Column #: 3
+getString(3) length 86
+43335858585858585858585858585858585858585858585858585858585858585858585858585858585858
+Column #: 4
+getString(4) length 100
+C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                                        
+Column #: 5
+getString(5) length 45
+C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+getString(6) length 46
+C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 2
+Max Field Size = 0
+Column #: 1
+getAsciiStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getAsciiStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getAsciiStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+getAsciiStream(4)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 5
+getAsciiStream(5)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #: 6
+getAsciiStream(6)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 3
+Max Field Size = 0
+Column #: 1
+getBinaryStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getBinaryStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getBinaryStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Iteration #: 4
+Max Field Size = 0
+Column #: 1
+getBytes(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #: 2
+getBytes(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 3
+getBytes(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Iteration #: 5
+Max Field Size = 24
+Column #: 1
+getObject(1)
+  as byte[] length 24
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getObject(2)
+  as byte[] length 24
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getObject(3)
+  as byte[] length 24
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+getObject(4)
+  as String
+C4XXXXXXXXXXXXXXXXXXXXXX
+Column #: 5
+getObject(5)
+  as String
+C5XXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+getObject(6)
+  as String
+C6XXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 6
+Max Field Size = 24
+Column #: 1
+getString(1) length 24
+433158585858585858585858
+Column #: 2
+getString(2) length 24
+433258585858585858585858
+Column #: 3
+getString(3) length 24
+433358585858585858585858
+Column #: 4
+getString(4) length 24
+C4XXXXXXXXXXXXXXXXXXXXXX
+Column #: 5
+getString(5) length 24
+C5XXXXXXXXXXXXXXXXXXXXXX
+Column #: 6
+getString(6) length 24
+C6XXXXXXXXXXXXXXXXXXXXXX
+Iteration #: 7
+Max Field Size = 24
+Column #: 1
+getAsciiStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getAsciiStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getAsciiStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+getAsciiStream(4)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 5
+getAsciiStream(5)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 6
+getAsciiStream(6)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 8
+Max Field Size = 24
+Column #: 1
+getBinaryStream(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getBinaryStream(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getBinaryStream(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Iteration #: 9
+Max Field Size = 24
+Column #: 1
+getBytes(1)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 2
+getBytes(2)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 3
+getBytes(3)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #: 4
+SKIPPING
+Column #: 5
+SKIPPING
+Column #: 6
+SKIPPING
+Expected Exception - Invalid maxFieldsize
+Doing external sort
+Max Field Size = 0
+Iteration #: 0
+Column #1: 4999
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 1
+Column #1: 4998
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 2
+Column #1: 4997
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 3
+Column #1: 4996
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4
+Column #1: 4995
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4995
+Column #1: 4
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4996
+Column #1: 3
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4997
+Column #1: 2
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4998
+Column #1: 1
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Iteration #: 4999
+Column #1: 0
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20x20
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58x58x58
+Max Field Size = 24
+Iteration #: 0
+Column #1: 4999
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 1
+Column #1: 4998
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 2
+Column #1: 4997
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 3
+Column #1: 4996
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4
+Column #1: 4995
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4995
+Column #1: 4
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4996
+Column #1: 3
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4997
+Column #1: 2
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4998
+Column #1: 1
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Iteration #: 4999
+Column #1: 0
+Column #2:
+getBinaryStream(2)
+x43x31x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #3:
+getBinaryStream(3)
+x43x32x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #4:
+getBinaryStream(4)
+x43x33x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #5:
+getAsciiStream(5)
+x43x34x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #6:
+getAsciiStream(6)
+x43x35x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Column #7:
+getAsciiStream(7)
+x43x36x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58x58
+x58x58x58
+Test maxfieldsize  finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,14 @@
+Test metadataJdbc20 starting
+JDBC Driver 'Apache Derby Embedded JDBC Driver', version 10.1 (10.1.0.0 alpha)
+The URL is: jdbc:derby:wombat
+getUDTs() with user-named types null :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('JAVA_OBJECT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('STRUCT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('DISTINCT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+getUDTs() with user-named types in ('JAVA_OBJECT', 'STRUCT') :
+TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+Test metadataJdbc20 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nullSQLText.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nullSQLText.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nullSQLText.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,14 @@
+Test nullSQLText starting
+Test prepareStatement with null argument
+FAIL -- expected exception
+Null SQL String Exception
+Test execute with null argument
+FAIL -- expected exception
+Null SQL String Exception
+Test executeQuery with null argument
+FAIL -- expected exception
+Null SQL String Exception
+Test executeUpdate with null argument
+FAIL -- expected exception
+Null SQL String Exception
+Test nullSQLText finished
\ No newline at end of file

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/openScans.out	Tue Jan 11 11:53:57 2005
@@ -1,6 +1,6 @@
 ij> -- minimal testing to verify no scans left open
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> autocommit off;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmtMetaData.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmtMetaData.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/prepStmtMetaData.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,26 @@
+Test prepStmtMetaData starting
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+Result meta data for select
+A,B
+ResultSetMetaData is Null or empty
+ResultSetMetaData is Null or empty
+bug 4579 and 5338 : Result meta data for select *
+C11
+bug 4579 and 5338 : Result meta data for select * after alter table but w/o execute query
+C11,C12
+bug 4579 and 5338 : Result meta data for select * after alter table and execute query
+C11,C12,C13
+Test prepStmtMetaData finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/procedureJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/procedureJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/procedureJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,195 @@
+Fetching result sets with getMoreResults()
+  PASS 1 got result set true
+     RS (1) val 2
+  PASS 2 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (2) val 3
+  PASS 3 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (3) val 4
+  PASS 4 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (4) val 5
+  PASS 5 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (5) val 6
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Fetching result sets with getMoreResults(Statement.CLOSE_CURRENT_RESULT)
+  PASS 1 got result set true
+     RS (1) val 2
+  PASS 2 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (2) val 3
+  PASS 3 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (3) val 4
+  PASS 4 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (4) val 5
+  PASS 5 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (5) val 6
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Fetching result sets with getMoreResults(Statement.CLOSE_ALL_RESULTS)
+  PASS 1 got result set true
+     RS (1) val 2
+  PASS 2 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (2) val 3
+  PASS 3 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (3) val 4
+  PASS 4 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (4) val 5
+  PASS 5 got result set true
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (5) val 6
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Fetching result sets with getMoreResults(Statement.KEEP_CURRENT_RESULT)
+  PASS 1 got result set true
+     RS (1) val 2
+  PASS 2 got result set true
+     RS (1) val 3
+     RS (2) val 3
+  PASS 3 got result set true
+     RS (1) val 4
+     RS (2) val 4
+     RS (3) val 4
+  PASS 4 got result set true
+     RS (1) val 5
+     RS (2) val 5
+     RS (3) val 5
+     RS (4) val 5
+  PASS 5 got result set true
+     RS (1) val 6
+     RS (2) val 6
+     RS (3) val 6
+     RS (4) val 6
+     RS (5) val 6
+     RS (1) val 7
+     RS (2) val 7
+     RS (3) val 7
+     RS (4) val 7
+     RS (5) val 7
+Fetching result sets with getMoreResults(<mixture>)
+ first two with KEEP_CURRENT_RESULT
+     RS (1) val 2
+     RS (2) val 3
+ third with CLOSE_CURRENT_RESULT
+     RS (1) val 3
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (3) val 4
+ fourth with KEEP_CURRENT_RESULT
+     RS (1) val 4
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (3) val 5
+     RS (4) val 5
+ fifth with CLOSE_ALL_RESULTS
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (5) val 6
+ no more results with with KEEP_CURRENT_RESULT
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     RS (5) val 7
+Fetching result sets with getMoreResults(Statement.KEEP_CURRENT_RESULT) and checking that cs.execute() closes them
+  PASS 1 got result set true
+     RS (1) val 2
+  PASS 2 got result set true
+     RS (1) val 3
+     RS (2) val 3
+  PASS 3 got result set true
+     RS (1) val 4
+     RS (2) val 4
+     RS (3) val 4
+  PASS 4 got result set true
+     RS (1) val 5
+     RS (2) val 5
+     RS (3) val 5
+     RS (4) val 5
+  PASS 5 got result set true
+     RS (1) val 6
+     RS (2) val 6
+     RS (3) val 6
+     RS (4) val 6
+     RS (5) val 6
+ fetched all results
+     RS (1) val 7
+     RS (2) val 7
+     RS (3) val 7
+     RS (4) val 7
+     RS (5) val 7
+ executing statement
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Fetching result sets with getMoreResults(Statement.KEEP_CURRENT_RESULT) and checking that cs.close() closes them
+  PASS 1 got result set true
+     RS (1) val 2
+  PASS 2 got result set true
+     RS (1) val 3
+     RS (2) val 3
+  PASS 3 got result set true
+     RS (1) val 4
+     RS (2) val 4
+     RS (3) val 4
+  PASS 4 got result set true
+     RS (1) val 5
+     RS (2) val 5
+     RS (3) val 5
+     RS (4) val 5
+  PASS 5 got result set true
+     RS (1) val 6
+     RS (2) val 6
+     RS (3) val 6
+     RS (4) val 6
+     RS (5) val 6
+ fetched all results
+     RS (1) val 7
+     RS (2) val 7
+     RS (3) val 7
+     RS (4) val 7
+     RS (5) val 7
+ closing statement
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+     Exception - ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readUncommitted.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readUncommitted.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readUncommitted.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,221 @@
+ij> ------------------------------------------------------------------------------
+-- TEST CASES SPECIFIC TO STORE IMPLEMENTATION OF READ UNCOMMITTED:
+-- overview:
+--    TEST 0: Test a scan positioned on a row which is deleted from it.
+--    TEST 1: Test a scan positioned on a row which is purged from it.
+------------------------------------------------------------------------------
+--
+------------------------------------------------------------------------------
+run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'com.ibm.db2j.testing.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 'com.ibm.db2j.testing.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> connect 'wombat' as scanner;
+ij(SCANNER)> autocommit off;
+ij(SCANNER)> connect 'wombat' as deleter;
+ij(DELETER)> autocommit off;
+ij(DELETER)> ------------------------------------------------------------------------------
+-- TEST 0: Test a scan positioned on a row which is deleted from it.
+------------------------------------------------------------------------------
+set connection scanner;
+ij(SCANNER)> set current isolation to UR;
+0 rows inserted/updated/deleted
+ij(SCANNER)> drop table data;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'DATA' because it does not exist.
+ij(SCANNER)> -- create a table with 2 rows per index page.
+create table data (keycol int, data varchar(1600)) ;
+0 rows inserted/updated/deleted
+ij(SCANNER)> insert into data values (0, PADSTRING('0',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (10, PADSTRING('100',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (20, PADSTRING('200',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (30, PADSTRING('300',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (40, PADSTRING('400',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (50, PADSTRING('100',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (60, PADSTRING('200',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (70, PADSTRING('300',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (80, PADSTRING('400',1600));
+1 row inserted/updated/deleted
+ij(SCANNER)> create index idx on data (keycol, data) ;
+0 rows inserted/updated/deleted
+ij(SCANNER)> commit;
+ij(SCANNER)> set connection deleter;
+ij(DELETER)> SET ISOLATION READ COMMITTED;
+0 rows inserted/updated/deleted
+ij(DELETER)> commit;
+ij(DELETER)> -- position scanner with no bulk fetch on 40,400
+set connection scanner;
+ij(SCANNER)> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij(SCANNER)> get cursor scan_cursor as
+    'select keycol from data';
+ij(SCANNER)> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+0 rows inserted/updated/deleted
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+0          
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+10         
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+20         
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+30         
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+40         
+ij(SCANNER)> -- now delete all the rows except for 70 and 80
+set connection deleter;
+ij(DELETER)> delete from data where keycol < 70;
+7 rows inserted/updated/deleted
+ij(DELETER)> -- scanner should automatically jump to 70
+set connection scanner;
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+70         
+ij(SCANNER)> -- cleanup
+close scan_cursor;
+ij(SCANNER)> commit;
+ij(SCANNER)> set connection deleter;
+ij(DELETER)> commit;
+ij(DELETER)> ------------------------------------------------------------------------------
+-- TEST 1: Test a scan positioned on a row which is purged.
+------------------------------------------------------------------------------
+set connection scanner;
+ij(SCANNER)> set isolation read uncommitted;
+0 rows inserted/updated/deleted
+ij(SCANNER)> drop table data;
+0 rows inserted/updated/deleted
+ij(SCANNER)> -- create a table with 3 rows per index page.
+create table data (keycol int, data varchar(1200));
+0 rows inserted/updated/deleted
+ij(SCANNER)> insert into data values (0, PADSTRING('0',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (10, PADSTRING('100',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (20, PADSTRING('200',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (30, PADSTRING('300',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (40, PADSTRING('400',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (50, PADSTRING('100',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (60, PADSTRING('200',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (70, PADSTRING('300',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> insert into data values (80, PADSTRING('400',1200));
+1 row inserted/updated/deleted
+ij(SCANNER)> create index idx on data (keycol, data) ;
+0 rows inserted/updated/deleted
+ij(SCANNER)> commit;
+ij(SCANNER)> -- position scanner with no bulk fetch on 0,0 (first row in btree)
+set connection scanner;
+ij(SCANNER)> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij(SCANNER)> get cursor scan_cursor as
+    'select keycol from data';
+ij(SCANNER)> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+0 rows inserted/updated/deleted
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+0          
+ij(SCANNER)> -- delete all the rows in the table except for the last few pages, and the 1st;
+set connection deleter;
+ij(DELETER)> delete from data where keycol < 50 and keycol > 0;
+4 rows inserted/updated/deleted
+ij(DELETER)> -- insert enough rows after the first to force a split by the scanner on the 1st
+-- page, it will now be positioned by key on the (0, 0) key.   Then delete the
+-- rows that we just inserted.
+set connection scanner;
+ij(SCANNER)> insert into data values (9, '3'), (9, '2'), (9, '1');
+3 rows inserted/updated/deleted
+ij(SCANNER)> delete from data where keycol = 9;
+3 rows inserted/updated/deleted
+ij(SCANNER)> -- delete the key that the scan is positioned on.  
+set connection deleter;
+ij(DELETER)> delete from data where keycol = 0;
+1 row inserted/updated/deleted
+ij(DELETER)> commit;
+ij(DELETER)> set connection scanner;
+ij(SCANNER)> -- this should now cause another split on the first page in the btree, this
+-- time it should reclaim row 0.
+insert into data values (8, '3'), (8, '2'), (8, '1');
+3 rows inserted/updated/deleted
+ij(SCANNER)> -- scanner should automatically jump to 8, handling the fact that row (0,0)
+-- no longer exists in the table.
+set connection scanner;
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+50         
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+60         
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+70         
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+80         
+ij(SCANNER)> -- delete all the rows that remain except the last;
+set connection deleter;
+ij(DELETER)> delete from data where keycol > 10 and keycol < 80;
+3 rows inserted/updated/deleted
+ij(DELETER)> commit;
+ij(DELETER)> -- position scan on last row of scan.
+set connection scanner;
+ij(SCANNER)> next scan_cursor;
+KEYCOL     
+-----------
+8          
+ij(SCANNER)> -- now repeat process from above to make the current scan position disappear to
+-- test code path executed when closing a scan where the last scan position has
+-- disappeared.
+set connection scanner;
+ij(SCANNER)> insert into data values (82, '3'), (82, '2'), (82, '1');
+3 rows inserted/updated/deleted
+ij(SCANNER)> delete from data where keycol = 81;
+0 rows inserted/updated/deleted
+ij(SCANNER)> set connection deleter;
+ij(DELETER)> delete from data where keycol = 80;
+1 row inserted/updated/deleted
+ij(DELETER)> commit;
+ij(DELETER)> set connection scanner;
+ij(SCANNER)> -- this statement will purge (80, 800) from the table.
+insert into data values (81, '3'), (81, '2'), (81, '1');
+3 rows inserted/updated/deleted
+ij(SCANNER)> delete from data where keycol = 81;
+3 rows inserted/updated/deleted
+ij(SCANNER)> -- this statement will execute code which will look for last key positioned on
+-- while closing the statement.
+close scan_cursor;
+ij(SCANNER)> -- cleanup
+set connection scanner;
+ij(SCANNER)> commit;
+ij(SCANNER)> set connection deleter;
+ij(DELETER)> commit;
+ij(DELETER)> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readlocks.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readlocks.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/readlocks.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,26253 @@
+ij> -- Very basic single user testing of update row locking.
+autocommit off;
+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> commit;
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> -- READ UNCOMMITTED TEST
+set isolation read uncommitted;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+      -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |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 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,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 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900), 
+    PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900), 
+    PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900), 
+    PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900), 
+    PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900), 
+    PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900), 
+    PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900), 
+    PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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          
+-----------
+7          
+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> 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 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+6          
+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          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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           |(2,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 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+6          
+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          
+-----------
+7          
+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> 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 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+6          
+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          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- READ COMMITTED TEST
+set isolation read committed;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> 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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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;
+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 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |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 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> 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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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;
+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 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> --------------------------------------------------------------------------------
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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,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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+6          
+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          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,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> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+6          
+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          
+-----------
+7          
+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> 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 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+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           |(2,1)     |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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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  
+ij> next scan_cursor;
+A          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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;
+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 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,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> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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;
+A          
+-----------
+7          
+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> 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 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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> 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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+A          
+-----------
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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> 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  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+A          
+-----------
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- REPEATABLE READ TEST
+set current isolation RS;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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           |(1,8)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+      -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |GRANT|ACTIVE  
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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> 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  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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> 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  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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,11)    |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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> commit;
+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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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,11)    |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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> commit;
+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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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           |(1,8)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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,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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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,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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> commit;
+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  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900), 
+    PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900), 
+    PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900), 
+    PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900), 
+    PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900), 
+    PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900), 
+    PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900), 
+    PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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> 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  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+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,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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> 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  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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> commit;
+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> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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> 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 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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> commit;
+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> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- SERIALIZABLE TEST
+set isolation serializable;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+      -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> 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 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> 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 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+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> 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 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> 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  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+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          
+-----------
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: A_IDX.
+ij> drop index ix1;
+ERROR 42X65: Index 'IX1' does not exist.
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a from a where a = 42';
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> 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 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> 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 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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,11)    |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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,13)    |GRANT|ACTIVE  
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> 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 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> 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 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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,13)    |GRANT|ACTIVE  
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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, c 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, c 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a < 3';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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, c from a where a = 7';
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'readSetLocks.subsql';
+ij> -- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> 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 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+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> 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 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+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> 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 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 5;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> 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  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a, b, c from a where a = 7;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one', 1900), 
+    PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two', 1900), 
+    PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three', 1900), 
+    PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four', 1900), 
+    PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five', 1900), 
+    PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six', 1900), 
+    PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven', 1900), 
+    PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+6          
+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> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> 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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+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   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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> 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   |S   |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   |S   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a < 3';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,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  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |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   |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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+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 statement 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 from a where a = 5 or a = 7';
+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          
+-----------
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+7          
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+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 statement 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 from a where a = 42';
+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;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,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  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |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   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> 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 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> 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 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'readBtreeSetLocks.subsql';
+ij> -- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+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> 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 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+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> 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 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a < 3;
+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  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select a from a where a = 5;
+A          
+-----------
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+-- no rows expected to qualify
+select a from a where a = 42;
+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           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1014 @@
+Test resultset starting
+getColumnCount(): 16
+isAutoIncrement(1): false
+isCaseSensitive(1): false
+isSearchable(1): true
+isCurrency(1): false
+isNullable(1): 1
+isSigned(1): true
+getColumnDisplaySize(1): 11
+getColumnLabel(1): I
+getColumnName(1): I
+getTableName(1): T
+getSchemaName(1): 
+getCatalogName(1): 
+getColumnType(1): 4
+getPrecision(1): 10
+getScale(1): 0
+getColumnTypeName(1): INTEGER
+isReadOnly(1): false
+isWritable(1): Expected isWritable value
+isDefinitelyWritable(1): false
+isAutoIncrement(2): false
+isCaseSensitive(2): false
+isSearchable(2): true
+isCurrency(2): false
+isNullable(2): 1
+isSigned(2): true
+getColumnDisplaySize(2): 6
+getColumnLabel(2): S
+getColumnName(2): S
+getTableName(2): T
+getSchemaName(2): 
+getCatalogName(2): 
+getColumnType(2): 5
+getPrecision(2): 5
+getScale(2): 0
+getColumnTypeName(2): SMALLINT
+isReadOnly(2): false
+isWritable(2): Expected isWritable value
+isDefinitelyWritable(2): false
+isAutoIncrement(3): false
+isCaseSensitive(3): false
+isSearchable(3): true
+isCurrency(3): false
+isNullable(3): 1
+isSigned(3): true
+getColumnDisplaySize(3): 13
+getColumnLabel(3): R
+getColumnName(3): R
+getTableName(3): T
+getSchemaName(3): 
+getCatalogName(3): 
+getColumnType(3): 7
+getPrecision(3): 7
+getScale(3): 0
+getColumnTypeName(3): REAL
+isReadOnly(3): false
+isWritable(3): Expected isWritable value
+isDefinitelyWritable(3): false
+isAutoIncrement(4): false
+isCaseSensitive(4): false
+isSearchable(4): true
+isCurrency(4): false
+isNullable(4): 1
+isSigned(4): true
+getColumnDisplaySize(4): 22
+getColumnLabel(4): D
+getColumnName(4): D
+getTableName(4): T
+getSchemaName(4): 
+getCatalogName(4): 
+getColumnType(4): 8
+getPrecision(4): 15
+getScale(4): 0
+getColumnTypeName(4): DOUBLE
+isReadOnly(4): false
+isWritable(4): Expected isWritable value
+isDefinitelyWritable(4): false
+isAutoIncrement(5): false
+isCaseSensitive(5): false
+isSearchable(5): true
+isCurrency(5): false
+isNullable(5): 1
+isSigned(5): false
+getColumnDisplaySize(5): 10
+getColumnLabel(5): DT
+getColumnName(5): DT
+getTableName(5): T
+getSchemaName(5): 
+getCatalogName(5): 
+getColumnType(5): 91
+getPrecision(5): 10
+getScale(5): 0
+getColumnTypeName(5): DATE
+isReadOnly(5): false
+isWritable(5): Expected isWritable value
+isDefinitelyWritable(5): false
+isAutoIncrement(6): false
+isCaseSensitive(6): false
+isSearchable(6): true
+isCurrency(6): false
+isNullable(6): 1
+isSigned(6): false
+getColumnDisplaySize(6): 8
+getColumnLabel(6): T
+getColumnName(6): T
+getTableName(6): T
+getSchemaName(6): 
+getCatalogName(6): 
+getColumnType(6): 92
+getPrecision(6): 0
+getScale(6): 0
+getColumnTypeName(6): TIME
+isReadOnly(6): false
+isWritable(6): Expected isWritable value
+isDefinitelyWritable(6): false
+isAutoIncrement(7): false
+isCaseSensitive(7): false
+isSearchable(7): true
+isCurrency(7): false
+isNullable(7): 1
+isSigned(7): false
+getColumnDisplaySize(7): 26
+getColumnLabel(7): TS
+getColumnName(7): TS
+getTableName(7): T
+getSchemaName(7): 
+getCatalogName(7): 
+getColumnType(7): 93
+getPrecision(7): 0
+getScale(7): 0
+getColumnTypeName(7): TIMESTAMP
+isReadOnly(7): false
+isWritable(7): Expected isWritable value
+isDefinitelyWritable(7): false
+isAutoIncrement(8): false
+isCaseSensitive(8): true
+isSearchable(8): true
+isCurrency(8): false
+isNullable(8): 1
+isSigned(8): false
+getColumnDisplaySize(8): 10
+getColumnLabel(8): C
+getColumnName(8): C
+getTableName(8): T
+getSchemaName(8): 
+getCatalogName(8): 
+getColumnType(8): 1
+getPrecision(8): 10
+getScale(8): 0
+getColumnTypeName(8): CHAR
+isReadOnly(8): false
+isWritable(8): Expected isWritable value
+isDefinitelyWritable(8): false
+isAutoIncrement(9): false
+isCaseSensitive(9): true
+isSearchable(9): true
+isCurrency(9): false
+isNullable(9): 0
+isSigned(9): false
+getColumnDisplaySize(9): 40
+getColumnLabel(9): V
+getColumnName(9): V
+getTableName(9): T
+getSchemaName(9): 
+getCatalogName(9): 
+getColumnType(9): 12
+getPrecision(9): 40
+getScale(9): 0
+getColumnTypeName(9): VARCHAR
+isReadOnly(9): false
+isWritable(9): Expected isWritable value
+isDefinitelyWritable(9): false
+isAutoIncrement(10): false
+isCaseSensitive(10): false
+isSearchable(10): true
+isCurrency(10): true
+isNullable(10): 1
+isSigned(10): true
+getColumnDisplaySize(10): 13
+getColumnLabel(10): DC
+getColumnName(10): DC
+getTableName(10): T
+getSchemaName(10): 
+getCatalogName(10): 
+getColumnType(10): 3
+getPrecision(10): 10
+getScale(10): 2
+getColumnTypeName(10): DECIMAL
+isReadOnly(10): false
+isWritable(10): Expected isWritable value
+isDefinitelyWritable(10): false
+isAutoIncrement(11): false
+isCaseSensitive(11): false
+isSearchable(11): true
+isCurrency(11): false
+isNullable(11): 1
+isSigned(11): true
+getColumnDisplaySize(11): 20
+getColumnLabel(11): BI
+getColumnName(11): BI
+getTableName(11): T
+getSchemaName(11): 
+getCatalogName(11): 
+getColumnType(11): -5
+getPrecision(11): 19
+getScale(11): 0
+getColumnTypeName(11): BIGINT
+isReadOnly(11): false
+isWritable(11): Expected isWritable value
+isDefinitelyWritable(11): false
+isAutoIncrement(12): false
+isCaseSensitive(12): false
+isSearchable(12): true
+isCurrency(12): false
+isNullable(12): 1
+isSigned(12): false
+getColumnDisplaySize(12): 20
+getColumnLabel(12): CBD
+getColumnName(12): CBD
+getTableName(12): T
+getSchemaName(12): 
+getCatalogName(12): 
+getColumnType(12): -2
+getPrecision(12): 10
+getScale(12): 0
+getColumnTypeName(12): CHAR () FOR BIT DATA
+isReadOnly(12): false
+isWritable(12): Expected isWritable value
+isDefinitelyWritable(12): false
+isAutoIncrement(13): false
+isCaseSensitive(13): false
+isSearchable(13): true
+isCurrency(13): false
+isNullable(13): 1
+isSigned(13): false
+getColumnDisplaySize(13): 20
+getColumnLabel(13): VBD
+getColumnName(13): VBD
+getTableName(13): T
+getSchemaName(13): 
+getCatalogName(13): 
+getColumnType(13): -3
+getPrecision(13): 10
+getScale(13): 0
+getColumnTypeName(13): VARCHAR () FOR BIT DATA
+isReadOnly(13): false
+isWritable(13): Expected isWritable value
+isDefinitelyWritable(13): false
+isAutoIncrement(14): false
+isCaseSensitive(14): false
+isSearchable(14): true
+isCurrency(14): false
+isNullable(14): 1
+isSigned(14): false
+getColumnDisplaySize(14): 65400
+getColumnLabel(14): LVBD
+getColumnName(14): LVBD
+getTableName(14): T
+getSchemaName(14): 
+getCatalogName(14): 
+getColumnType(14): -4
+getPrecision(14): 32700
+getScale(14): 0
+getColumnTypeName(14): LONG VARCHAR FOR BIT DATA
+isReadOnly(14): false
+isWritable(14): Expected isWritable value
+isDefinitelyWritable(14): false
+isAutoIncrement(15): false
+isCaseSensitive(15): true
+isSearchable(15): true
+isCurrency(15): false
+isNullable(15): 1
+isSigned(15): false
+getColumnDisplaySize(15): 2147483647
+getColumnLabel(15): CL
+getColumnName(15): CL
+getTableName(15): T
+getSchemaName(15): 
+getCatalogName(15): 
+getColumnType(15): 2005
+getPrecision(15): 2147483647
+getScale(15): 0
+getColumnTypeName(15): CLOB
+isReadOnly(15): false
+isWritable(15): Expected isWritable value
+isDefinitelyWritable(15): false
+isAutoIncrement(16): false
+isCaseSensitive(16): false
+isSearchable(16): true
+isCurrency(16): false
+isNullable(16): 1
+isSigned(16): false
+getColumnDisplaySize(16): 2147483647
+getColumnLabel(16): BL
+getColumnName(16): BL
+getTableName(16): T
+getSchemaName(16): 
+getCatalogName(16): 
+getColumnType(16): 2004
+getPrecision(16): 1073741824
+getScale(16): 0
+getColumnTypeName(16): BLOB
+isReadOnly(16): false
+isWritable(16): Expected isWritable value
+isDefinitelyWritable(16): false
+getBigDecimal(1,1): 1.0
+getBigDecimal(i,1): 1.0
+getBoolean(1): true
+getBoolean(i): true
+getByte(1): 1
+getByte(i): 1
+getBytes(1) got exception 
+Data Conversion SQLException
+getBytes(i) got exception 
+Data Conversion SQLException
+getDate(1) got exception 
+Data Conversion SQLException
+getDate(i) got exception 
+Data Conversion SQLException
+getDouble(1): 1.0
+getDouble(i): 1.0
+getFloat(1): 1.0
+getFloat(i): 1.0
+getInt(1): 1
+getInt(i): 1
+getLong(1): 1
+getLong(i): 1
+getObject(1): 1
+getObject(i): 1
+getShort(1): 1
+getShort(i): 1
+getString(1): 1
+getString(i): 1
+getTime(1) got exception 
+Data Conversion SQLException
+getTime(i) got exception 
+Data Conversion SQLException
+getTimestamp(1) got exception 
+Data Conversion SQLException
+getTimestamp(i) got exception 
+Data Conversion SQLException
+getBigDecimal(2,1): 2.0
+getBigDecimal(s,1): 2.0
+getBoolean(2): true
+getBoolean(s): true
+getByte(2): 2
+getByte(s): 2
+getBytes(2) got exception 
+Data Conversion SQLException
+getBytes(s) got exception 
+Data Conversion SQLException
+getDate(2) got exception 
+Data Conversion SQLException
+getDate(s) got exception 
+Data Conversion SQLException
+getDouble(2): 2.0
+getDouble(s): 2.0
+getFloat(2): 2.0
+getFloat(s): 2.0
+getInt(2): 2
+getInt(s): 2
+getLong(2): 2
+getLong(s): 2
+getObject(2): 2
+getObject(s): 2
+getShort(2): 2
+getShort(s): 2
+getString(2): 2
+getString(s): 2
+getTime(2) got exception 
+Data Conversion SQLException
+getTime(s) got exception 
+Data Conversion SQLException
+getTimestamp(2) got exception 
+Data Conversion SQLException
+getTimestamp(s) got exception 
+Data Conversion SQLException
+getBigDecimal(3,1): 3.3
+getBigDecimal(r,1): 3.3
+getBoolean(3): true
+getBoolean(r): true
+getByte(3): 3
+getByte(r): 3
+getBytes(3) got exception 
+Data Conversion SQLException
+getBytes(r) got exception 
+Data Conversion SQLException
+getDate(3) got exception 
+Data Conversion SQLException
+getDate(r) got exception 
+Data Conversion SQLException
+getDouble(3): 3.299999952316284
+getDouble(r): 3.299999952316284
+getFloat(3): 3.3
+getFloat(r): 3.3
+getInt(3): 3
+getInt(r): 3
+getLong(3): 3
+getLong(r): 3
+getObject(3): 3.3
+getObject(r): 3.3
+getShort(3): 3
+getShort(r): 3
+getString(3): 3.3
+getString(r): 3.3
+getTime(3) got exception 
+Data Conversion SQLException
+getTime(r) got exception 
+Data Conversion SQLException
+getTimestamp(3) got exception 
+Data Conversion SQLException
+getTimestamp(r) got exception 
+Data Conversion SQLException
+getBigDecimal(4,1): 4.4
+getBigDecimal(d,1): 4.4
+getBoolean(4): true
+getBoolean(d): true
+getByte(4): 4
+getByte(d): 4
+getBytes(4) got exception 
+Data Conversion SQLException
+getBytes(d) got exception 
+Data Conversion SQLException
+getDate(4) got exception 
+Data Conversion SQLException
+getDate(d) got exception 
+Data Conversion SQLException
+getDouble(4): 4.4
+getDouble(d): 4.4
+getFloat(4): 4.4
+getFloat(d): 4.4
+getInt(4): 4
+getInt(d): 4
+getLong(4): 4
+getLong(d): 4
+getObject(4): 4.4
+getObject(d): 4.4
+getShort(4): 4
+getShort(d): 4
+getString(4): 4.4
+getString(d): 4.4
+getTime(4) got exception 
+Data Conversion SQLException
+getTime(d) got exception 
+Data Conversion SQLException
+getTimestamp(4) got exception 
+Data Conversion SQLException
+getTimestamp(d) got exception 
+Data Conversion SQLException
+getBigDecimal(5,1) got exception 
+Data Conversion SQLException
+getBigDecimal(dt,1) got exception 
+Data Conversion SQLException
+getBoolean(5) got exception 
+Data Conversion SQLException
+getBoolean(dt) got exception 
+Data Conversion SQLException
+getByte(5) got exception 
+Data Conversion SQLException
+getByte(dt) got exception 
+Data Conversion SQLException
+getBytes(5) got exception 
+Data Conversion SQLException
+getBytes(dt) got exception 
+Data Conversion SQLException
+getDate(5): 1990-05-05
+getDate(dt): 1990-05-05
+getDouble(5) got exception 
+Data Conversion SQLException
+getDouble(dt) got exception 
+Data Conversion SQLException
+getFloat(5) got exception 
+Data Conversion SQLException
+getFloat(dt) got exception 
+Data Conversion SQLException
+getInt(5) got exception 
+Data Conversion SQLException
+getInt(dt) got exception 
+Data Conversion SQLException
+getLong(5) got exception 
+Data Conversion SQLException
+getLong(dt) got exception 
+Data Conversion SQLException
+getObject(5): 1990-05-05
+getObject(dt): 1990-05-05
+getShort(5) got exception 
+Data Conversion SQLException
+getShort(dt) got exception 
+Data Conversion SQLException
+getString(5): 1990-05-05
+getString(dt): 1990-05-05
+getTime(5) got exception 
+Data Conversion SQLException
+getTime(dt) got exception 
+Data Conversion SQLException
+getTimestamp(5): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTimestamp(dt): xxxxxxFILTERED-TIMESTAMPxxxxx
+getBigDecimal(6,1) got exception 
+Data Conversion SQLException
+getBigDecimal(t,1) got exception 
+Data Conversion SQLException
+getBoolean(6) got exception 
+Data Conversion SQLException
+getBoolean(t) got exception 
+Data Conversion SQLException
+getByte(6) got exception 
+Data Conversion SQLException
+getByte(t) got exception 
+Data Conversion SQLException
+getBytes(6) got exception 
+Data Conversion SQLException
+getBytes(t) got exception 
+Data Conversion SQLException
+getDate(6) got exception 
+Data Conversion SQLException
+getDate(t) got exception 
+Data Conversion SQLException
+getDouble(6) got exception 
+Data Conversion SQLException
+getDouble(t) got exception 
+Data Conversion SQLException
+getFloat(6) got exception 
+Data Conversion SQLException
+getFloat(t) got exception 
+Data Conversion SQLException
+getInt(6) got exception 
+Data Conversion SQLException
+getInt(t) got exception 
+Data Conversion SQLException
+getLong(6) got exception 
+Data Conversion SQLException
+getLong(t) got exception 
+Data Conversion SQLException
+getObject(6): 12:06:06
+getObject(t): 12:06:06
+getShort(6) got exception 
+Data Conversion SQLException
+getShort(t) got exception 
+Data Conversion SQLException
+getString(6): 12:06:06
+getString(t): 12:06:06
+getTime(6): 12:06:06
+getTime(t): 12:06:06
+getTimestamp(6): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTimestamp(t): xxxxxxFILTERED-TIMESTAMPxxxxx
+getBigDecimal(7,1) got exception 
+Data Conversion SQLException
+getBigDecimal(ts,1) got exception 
+Data Conversion SQLException
+getBoolean(7) got exception 
+Data Conversion SQLException
+getBoolean(ts) got exception 
+Data Conversion SQLException
+getByte(7) got exception 
+Data Conversion SQLException
+getByte(ts) got exception 
+Data Conversion SQLException
+getBytes(7) got exception 
+Data Conversion SQLException
+getBytes(ts) got exception 
+Data Conversion SQLException
+getDate(7): 1990-07-07
+getDate(ts): 1990-07-07
+getDouble(7) got exception 
+Data Conversion SQLException
+getDouble(ts) got exception 
+Data Conversion SQLException
+getFloat(7) got exception 
+Data Conversion SQLException
+getFloat(ts) got exception 
+Data Conversion SQLException
+getInt(7) got exception 
+Data Conversion SQLException
+getInt(ts) got exception 
+Data Conversion SQLException
+getLong(7) got exception 
+Data Conversion SQLException
+getLong(ts) got exception 
+Data Conversion SQLException
+getObject(7): xxxxxxFILTERED-TIMESTAMPxxxxx
+getObject(ts): xxxxxxFILTERED-TIMESTAMPxxxxx
+getShort(7) got exception 
+Data Conversion SQLException
+getShort(ts) got exception 
+Data Conversion SQLException
+getString(7): xxxxxxFILTERED-TIMESTAMPxxxxx
+getString(ts): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTime(7): 07:07:07
+getTime(ts): 07:07:07
+getTimestamp(7): xxxxxxFILTERED-TIMESTAMPxxxxx
+getTimestamp(ts): xxxxxxFILTERED-TIMESTAMPxxxxx
+getBigDecimal(8,1) got exception 
+Data Conversion SQLException
+getBigDecimal(c,1) got exception 
+Data Conversion SQLException
+getBoolean(8): true
+getBoolean(c): true
+getByte(8) got exception 
+Data Conversion SQLException
+getByte(c) got exception 
+Data Conversion SQLException
+getBytes(8) got exception 
+Data Conversion SQLException
+getBytes(c) got exception 
+Data Conversion SQLException
+getDate(8) got exception 
+Data Conversion SQLException
+getDate(c) got exception 
+Data Conversion SQLException
+getDouble(8) got exception 
+Data Conversion SQLException
+getDouble(c) got exception 
+Data Conversion SQLException
+getFloat(8) got exception 
+Data Conversion SQLException
+getFloat(c) got exception 
+Data Conversion SQLException
+getInt(8) got exception 
+Data Conversion SQLException
+getInt(c) got exception 
+Data Conversion SQLException
+getLong(8) got exception 
+Data Conversion SQLException
+getLong(c) got exception 
+Data Conversion SQLException
+getObject(8): eight     
+getObject(c): eight     
+getShort(8) got exception 
+Data Conversion SQLException
+getShort(c) got exception 
+Data Conversion SQLException
+getString(8): eight     
+getString(c): eight     
+getTime(8) got exception 
+Data Conversion SQLException
+getTime(c) got exception 
+Data Conversion SQLException
+getTimestamp(8) got exception 
+Data Conversion SQLException
+getTimestamp(c) got exception 
+Data Conversion SQLException
+getBigDecimal(9,1) got exception 
+Data Conversion SQLException
+getBigDecimal(v,1) got exception 
+Data Conversion SQLException
+getBoolean(9): true
+getBoolean(v): true
+getByte(9) got exception 
+Data Conversion SQLException
+getByte(v) got exception 
+Data Conversion SQLException
+getBytes(9) got exception 
+Data Conversion SQLException
+getBytes(v) got exception 
+Data Conversion SQLException
+getDate(9) got exception 
+Data Conversion SQLException
+getDate(v) got exception 
+Data Conversion SQLException
+getDouble(9) got exception 
+Data Conversion SQLException
+getDouble(v) got exception 
+Data Conversion SQLException
+getFloat(9) got exception 
+Data Conversion SQLException
+getFloat(v) got exception 
+Data Conversion SQLException
+getInt(9) got exception 
+Data Conversion SQLException
+getInt(v) got exception 
+Data Conversion SQLException
+getLong(9) got exception 
+Data Conversion SQLException
+getLong(v) got exception 
+Data Conversion SQLException
+getObject(9): nine
+getObject(v): nine
+getShort(9) got exception 
+Data Conversion SQLException
+getShort(v) got exception 
+Data Conversion SQLException
+getString(9): nine
+getString(v): nine
+getTime(9) got exception 
+Data Conversion SQLException
+getTime(v) got exception 
+Data Conversion SQLException
+getTimestamp(9) got exception 
+Data Conversion SQLException
+getTimestamp(v) got exception 
+Data Conversion SQLException
+getBigDecimal(10,1): 10.1
+getBigDecimal(dc,1): 10.1
+getBoolean(10): true
+getBoolean(dc): true
+getByte(10): 10
+getByte(dc): 10
+getBytes(10) got exception 
+Data Conversion SQLException
+getBytes(dc) got exception 
+Data Conversion SQLException
+getDate(10) got exception 
+Data Conversion SQLException
+getDate(dc) got exception 
+Data Conversion SQLException
+getDouble(10): 10.1
+getDouble(dc): 10.1
+getFloat(10): 10.1
+getFloat(dc): 10.1
+getInt(10): 10
+getInt(dc): 10
+getLong(10): 10
+getLong(dc): 10
+getObject(10): 10.10
+getObject(dc): 10.10
+getShort(10): 10
+getShort(dc): 10
+getString(10): 10.10
+getString(dc): 10.10
+getTime(10) got exception 
+Data Conversion SQLException
+getTime(dc) got exception 
+Data Conversion SQLException
+getTimestamp(10) got exception 
+Data Conversion SQLException
+getTimestamp(dc) got exception 
+Data Conversion SQLException
+getBigDecimal(11,1): 11.0
+getBigDecimal(bi,1): 11.0
+getBoolean(11): true
+getBoolean(bi): true
+getByte(11): 11
+getByte(bi): 11
+getBytes(11) got exception 
+Data Conversion SQLException
+getBytes(bi) got exception 
+Data Conversion SQLException
+getDate(11) got exception 
+Data Conversion SQLException
+getDate(bi) got exception 
+Data Conversion SQLException
+getDouble(11): 11.0
+getDouble(bi): 11.0
+getFloat(11): 11.0
+getFloat(bi): 11.0
+getInt(11): 11
+getInt(bi): 11
+getLong(11): 11
+getLong(bi): 11
+getObject(11): 11
+getObject(bi): 11
+getShort(11): 11
+getShort(bi): 11
+getString(11): 11
+getString(bi): 11
+getTime(11) got exception 
+Data Conversion SQLException
+getTime(bi) got exception 
+Data Conversion SQLException
+getTimestamp(11) got exception 
+Data Conversion SQLException
+getTimestamp(bi) got exception 
+Data Conversion SQLException
+getBigDecimal(12,1) got exception 
+Data Conversion SQLException
+getBigDecimal(cbd,1) got exception 
+Data Conversion SQLException
+getBoolean(12) got exception 
+Data Conversion SQLException
+getBoolean(cbd) got exception 
+Data Conversion SQLException
+getByte(12) got exception 
+Data Conversion SQLException
+getByte(cbd) got exception 
+Data Conversion SQLException
+getBytes(12): 0x007400770065006C0076
+getBytes(cbd): 0x007400770065006C0076
+getDate(12) got exception 
+Data Conversion SQLException
+getDate(cbd) got exception 
+Data Conversion SQLException
+getDouble(12) got exception 
+Data Conversion SQLException
+getDouble(cbd) got exception 
+Data Conversion SQLException
+getFloat(12) got exception 
+Data Conversion SQLException
+getFloat(cbd) got exception 
+Data Conversion SQLException
+getInt(12) got exception 
+Data Conversion SQLException
+getInt(cbd) got exception 
+Data Conversion SQLException
+getLong(12) got exception 
+Data Conversion SQLException
+getLong(cbd) got exception 
+Data Conversion SQLException
+getObject(12) is ok
+getObject(cbd) is ok 
+getShort(12) got exception 
+Data Conversion SQLException
+getShort(cbd) got exception 
+Data Conversion SQLException
+getString(12): 007400770065006c0076
+getString(cbd): 007400770065006c0076
+getTime(12) got exception 
+Data Conversion SQLException
+getTime(cbd) got exception 
+Data Conversion SQLException
+getTimestamp(12) got exception 
+Data Conversion SQLException
+getTimestamp(cbd) got exception 
+Data Conversion SQLException
+getBigDecimal(13,1) got exception 
+Data Conversion SQLException
+getBigDecimal(vbd,1) got exception 
+Data Conversion SQLException
+getBoolean(13) got exception 
+Data Conversion SQLException
+getBoolean(vbd) got exception 
+Data Conversion SQLException
+getByte(13) got exception 
+Data Conversion SQLException
+getByte(vbd) got exception 
+Data Conversion SQLException
+getBytes(13): 0x0033007400650065006E
+getBytes(vbd): 0x0033007400650065006E
+getDate(13) got exception 
+Data Conversion SQLException
+getDate(vbd) got exception 
+Data Conversion SQLException
+getDouble(13) got exception 
+Data Conversion SQLException
+getDouble(vbd) got exception 
+Data Conversion SQLException
+getFloat(13) got exception 
+Data Conversion SQLException
+getFloat(vbd) got exception 
+Data Conversion SQLException
+getInt(13) got exception 
+Data Conversion SQLException
+getInt(vbd) got exception 
+Data Conversion SQLException
+getLong(13) got exception 
+Data Conversion SQLException
+getLong(vbd) got exception 
+Data Conversion SQLException
+getObject(13) is ok
+getObject(vbd) is ok 
+getShort(13) got exception 
+Data Conversion SQLException
+getShort(vbd) got exception 
+Data Conversion SQLException
+getString(13): 0033007400650065006e
+getString(vbd): 0033007400650065006e
+getTime(13) got exception 
+Data Conversion SQLException
+getTime(vbd) got exception 
+Data Conversion SQLException
+getTimestamp(13) got exception 
+Data Conversion SQLException
+getTimestamp(vbd) got exception 
+Data Conversion SQLException
+getBigDecimal(14,1) got exception 
+Data Conversion SQLException
+getBigDecimal(lvbd,1) got exception 
+Data Conversion SQLException
+getBoolean(14) got exception 
+Data Conversion SQLException
+getBoolean(lvbd) got exception 
+Data Conversion SQLException
+getByte(14) got exception 
+Data Conversion SQLException
+getByte(lvbd) got exception 
+Data Conversion SQLException
+getBytes(14): 0x0034007400650065006E
+getBytes(lvbd): 0x0034007400650065006E
+getDate(14) got exception 
+Data Conversion SQLException
+getDate(lvbd) got exception 
+Data Conversion SQLException
+getDouble(14) got exception 
+Data Conversion SQLException
+getDouble(lvbd) got exception 
+Data Conversion SQLException
+getFloat(14) got exception 
+Data Conversion SQLException
+getFloat(lvbd) got exception 
+Data Conversion SQLException
+getInt(14) got exception 
+Data Conversion SQLException
+getInt(lvbd) got exception 
+Data Conversion SQLException
+getLong(14) got exception 
+Data Conversion SQLException
+getLong(lvbd) got exception 
+Data Conversion SQLException
+getObject(14) is ok
+getObject(lvbd) is ok 
+getShort(14) got exception 
+Data Conversion SQLException
+getShort(lvbd) got exception 
+Data Conversion SQLException
+getString(14): 0034007400650065006e
+getString(lvbd): 0034007400650065006e
+getTime(14) got exception 
+Data Conversion SQLException
+getTime(lvbd) got exception 
+Data Conversion SQLException
+getTimestamp(14) got exception 
+Data Conversion SQLException
+getTimestamp(lvbd) got exception 
+Data Conversion SQLException
+getBigDecimal(15,1): null
+getBigDecimal(cl,1): null
+getBoolean(15): false
+getBoolean(cl): false
+getByte(15): 0
+getByte(cl): 0
+getBytes(15): null
+getBytes(cl): null
+getDate(15): null
+getDate(cl): null
+getDouble(15): 0.0
+getDouble(cl): 0.0
+getFloat(15): 0.0
+getFloat(cl): 0.0
+getInt(15): 0
+getInt(cl): 0
+getLong(15): 0
+getLong(cl): 0
+getObject(15) is ok
+getObject(cl) is ok 
+getShort(15): 0
+getShort(cl): 0
+getString(15): null
+getString(cl): null
+getTime(15): null
+getTime(cl): null
+getTimestamp(15): null
+getTimestamp(cl): null
+getBigDecimal(16,1): null
+getBigDecimal(bl,1): null
+getBoolean(16): false
+getBoolean(bl): false
+getByte(16): 0
+getByte(bl): 0
+getBytes(16): null
+getBytes(bl): null
+getDate(16): null
+getDate(bl): null
+getDouble(16): 0.0
+getDouble(bl): 0.0
+getFloat(16): 0.0
+getFloat(bl): 0.0
+getInt(16): 0
+getInt(bl): 0
+getLong(16): 0
+getLong(bl): 0
+getObject(16) is ok
+getObject(bl) is ok 
+getShort(16): 0
+getShort(bl): 0
+getString(16): null
+getString(bl): null
+getTime(16): null
+getTime(bl): null
+getTimestamp(16): null
+getTimestamp(bl): null
+rs.next() on closed result set got exception 
+Result Set Closed Exception
+just auto commit
+  bug4810 1, 1
+  bug4810 1, 2
+  LOCK TABLE
+Locks are held
+  bug4810 1, 3
+  LOCK TABLE
+Locks are held
+  LOCK TABLE
+commit with auto commit
+  bug4810 1, 1
+  bug4810 1, 2
+commit
+  LOCK TABLE
+Result Set Closed Exception
+  LOCK TABLE
+  LOCK TABLE
+rollback with auto commit
+  bug4810 1, 1
+  bug4810 1, 2
+rollback
+  LOCK TABLE
+Result Set Closed Exception
+  LOCK TABLE
+  LOCK TABLE
+START testMutableValues
+CHECKING on getXXX()
+ROW 1
+ROW 2
+ROW 3
+OK EQUALITY OBJECT RETURNED column 4 existing 1
+OK EQUALITY OBJECT RETURNED column 5 existing 1
+OK EQUALITY OBJECT RETURNED column 6 existing 1
+CHECKING on getObject()
+ROW 1
+ROW 2
+ROW 3
+OK EQUALITY OBJECT RETURNED column 4 existing 1
+OK EQUALITY OBJECT RETURNED column 5 existing 1
+OK EQUALITY OBJECT RETURNED column 6 existing 1
+COMPLETE testMutableValues
+Test resultset finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,23 @@
+Test resultsetJdbc20 starting
+getColumnCount(): 10
+getColumnName(1): I
+getColumnClassName(1): java.lang.Integer
+getColumnName(2): S
+getColumnClassName(2): java.lang.Integer
+getColumnName(3): R
+getColumnClassName(3): java.lang.Float
+getColumnName(4): D
+getColumnClassName(4): java.lang.Double
+getColumnName(5): DT
+getColumnClassName(5): java.sql.Date
+getColumnName(6): T
+getColumnClassName(6): java.sql.Time
+getColumnName(7): TS
+getColumnClassName(7): java.sql.Timestamp
+getColumnName(8): C
+getColumnClassName(8): java.lang.String
+getColumnName(9): V
+getColumnClassName(9): java.lang.String
+getColumnName(10): DC
+getColumnClassName(10): java.math.BigDecimal
+Test resultsetJdbc20 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,22 @@
+Test resultsetJdbc30 starting
+trying rs.getURL(int) :
+Expected : Feature not implemented: no details.
+trying rs.getURL(String) :
+Expected : Feature not implemented: no details.
+trying rs.updateRef(int, Ref) :
+Expected : Feature not implemented: no details.
+trying rs.updateRef(String, Ref) :
+Expected : Feature not implemented: no details.
+trying rs.updateBlob(int, Blob) :
+Expected : Feature not implemented: no details.
+trying rs.updateBlob(String, Blob) :
+Expected : Feature not implemented: no details.
+trying rs.updateClob(int, Clob) :
+Expected : Feature not implemented: no details.
+trying rs.updateClob(String, Clob) :
+Expected : Feature not implemented: no details.
+trying rs.updateArray(int, Array) :
+Expected : Feature not implemented: no details.
+trying rs.updateClob(String, Array) :
+Expected : Feature not implemented: no details.
+Test resultsetJdbc30 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,16 @@
+Test resultsetStream starting
+getColumnCount(): 1
+Checksum of first 200 bytes 3061553656
+Size of file = 3470
+getColumnCount(): 2
+Checksum of first 200 bytes 3061553656
+second columns is 3470
+FAILS DUE TO BUG 5710
+getColumnCount(): 1
+len=56
+number of reads=56
+EXPECTED SQLSTATE(XSDA4): An unexpected exception was thrown
+EXPECTED SQLSTATE(XJ001): Java exception: 'Input stream held less data than requested length.: java.io.IOException'.
+EXPECTED SQLSTATE(XSDA4): An unexpected exception was thrown
+EXPECTED SQLSTATE(XJ001): Java exception: 'Input stream held less data than requested length.: java.io.IOException'.
+Test resultsetStream finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rollForwardBackup.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rollForwardBackup.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rollForwardBackup.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,866 @@
+ij> CREATE PROCEDURE RENAME_FILE(LOCATION VARCHAR(32000), NAME VARCHAR(32000), NEW_NAME  VARCHAR(32000)) DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.FTFileUtil.renameFile' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> --check whether log archive mode  enabling method is working
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 0);
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+true                                                                                                                            
+ij> --check whether the logArchive Mode is persistent across boots
+disconnect;
+ij> connect 'wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> connect 'wombat';
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+true                                                                                                                            
+ij> --check whether log archive mode  disabling method is working
+call SYSCS_UTIL.SYSCS_DISABLE_LOG_ARCHIVE_MODE(1);
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+false                                                                                                                           
+ij> --check whether the logArchive Mode disabling persistent across boots
+disconnect;
+ij> connect 'wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> connect 'wombat';
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+false                                                                                                                           
+ij> -- reenable the log archive mode again to see whether the 
+-- disabling has any side effects.
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 0);
+0 rows inserted/updated/deleted
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+true                                                                                                                            
+ij> disconnect;
+ij> connect 'wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> connect 'wombat';
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+true                                                                                                                            
+ij> --END OF PROPERTY ARCHIVE CHECKS
+---PERFORM DIFFERENT TYPES OF RESTORE
+create table t1(a int ) ;
+0 rows inserted/updated/deleted
+ij> insert into t1 values(1) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(2) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(3 ) ;
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 0);
+0 rows inserted/updated/deleted
+ij> insert into t1 values(4) ;
+1 row inserted/updated/deleted
+ij> insert into t1 values(5);
+1 row inserted/updated/deleted
+ij> insert into t1 values(6);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --performa rollforward recovery
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+ij> insert into t1 values(7);
+1 row inserted/updated/deleted
+ij> insert into t1 values(8);
+1 row inserted/updated/deleted
+ij> insert into t1 values(9);
+1 row inserted/updated/deleted
+ij> --take a backup again
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> insert into t1 values(10);
+1 row inserted/updated/deleted
+ij> insert into t1 values(11);
+1 row inserted/updated/deleted
+ij> insert into t1 values(12);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --perform complete version restore
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+ij> insert into t1 values(10);
+1 row inserted/updated/deleted
+ij> insert into t1 values(11);
+1 row inserted/updated/deleted
+ij> insert into t1 values(12);
+1 row inserted/updated/deleted
+ij> insert into t1 values(13);
+1 row inserted/updated/deleted
+ij> insert into t1 values(14);
+1 row inserted/updated/deleted
+ij> insert into t1 values(15);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --create a new database using wombat db backup copy with a different database name
+connect 'jdbc:derby:wombat1;createFrom=extinout/mybackup/wombat';
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+ij> insert into t1 values(16);
+1 row inserted/updated/deleted
+ij> insert into t1 values(17);
+1 row inserted/updated/deleted
+ij> insert into t1 values(18);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat1;shutdown=true';
+ERROR 08006: Database 'wombat1' shutdown.
+ij> disconnect;
+ij> ---BACKUP AND RESTORE USING LOGDEVICE.
+connect 'jdbc:derby:crwombat;createFrom=extinout/mybackup/wombat;logDevice=extinout/crwombatlog';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('crwombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),11);
+1          
+-----------
+crwombatlog
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+ij> insert into t1 values(19);
+1 row inserted/updated/deleted
+ij> insert into t1 values(20);
+1 row inserted/updated/deleted
+ij> insert into t1 values(21);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:crwombat;shutdown=true';
+ERROR 08006: Database 'crwombat' shutdown.
+ij> disconnect;
+ij> --do a plain boot , we should have the log device specified earlier.
+connect 'jdbc:derby:crwombat';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('crwombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),11);
+1          
+-----------
+crwombatlog
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+ij> insert into t1 values(22);
+1 row inserted/updated/deleted
+ij> insert into t1 values(23);
+1 row inserted/updated/deleted
+ij> insert into t1 values(24);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:crwombat;shutdown=true';
+ERROR 08006: Database 'crwombat' shutdown.
+ij> disconnect;
+ij> ---check the error case of log device only existing when
+-- we try to do createFrom .
+--following connection shoul fail.
+connect 'jdbc:derby:erwombat;createFrom=extinout/mybackup/wombat;logDevice=extinout/crwombatlog';
+ERROR XJ040: Failed to start database 'erwombat', see the next exception for details.
+ERROR XSLAT: Log directory extinout<ps>crwombatlog<ps>log exists. Please make sure specified logDevice location is correct.  
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat;logDevice=extinout/wombatlog';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+1        
+---------
+wombatlog
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+ij> insert into t1 values(19);
+1 row inserted/updated/deleted
+ij> insert into t1 values(20);
+1 row inserted/updated/deleted
+ij> insert into t1 values(21);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --restore again from backup case to make sure
+--backups are getting the log device property.	
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+1        
+---------
+wombatlog
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+ij> insert into t1 values(22);
+1 row inserted/updated/deleted
+ij> insert into t1 values(23);
+1 row inserted/updated/deleted
+ij> insert into t1 values(24);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --do a vannila boot and see the device to make sure the log device is still intact.
+connect 'jdbc:derby:wombat';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+1        
+---------
+wombatlog
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+ij> autocommit off;
+ij> insert into t1 values(25);
+1 row inserted/updated/deleted
+ij> insert into t1 values(26);
+1 row inserted/updated/deleted
+ij> insert into t1 values(27);
+1 row inserted/updated/deleted
+ij> rollback;
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --performa rollforward recovery with logDevice specified at backup
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+1        
+---------
+wombatlog
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+ij> insert into t1 values(25);
+1 row inserted/updated/deleted
+ij> insert into t1 values(26);
+1 row inserted/updated/deleted
+ij> insert into t1 values(27);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --perform a rollforward recovery with log device is moved
+--to some other place than what it was when backup was taken.
+--move the log to different dir name.
+connect 'jdbc:derby:dummycondb;createFrom=extinout/mybackup/wombat;logDevice=extinout/wombatlog1';
+ij> call RENAME_FILE(null,'extinout/wombatlog','extinout/wombatlogmoved');
+0 rows inserted/updated/deleted
+ij> disconnect;
+ij> connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat;logDevice=extinout/wombatlogmoved';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlogmoved',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),14);
+1             
+--------------
+wombatlogmoved
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+ij> insert into t1 values(30);
+1 row inserted/updated/deleted
+ij> insert into t1 values(31);
+1 row inserted/updated/deleted
+ij> insert into t1 values(32);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --do a plain boot and verify the log device.
+connect 'jdbc:derby:wombat';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlogmoved',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),14);
+1             
+--------------
+wombatlogmoved
+ij> select * from t1 ;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+30         
+31         
+32         
+ij> insert into t1 values(33);
+1 row inserted/updated/deleted
+ij> insert into t1 values(34);
+1 row inserted/updated/deleted
+ij> insert into t1 values(35);
+1 row inserted/updated/deleted
+ij> --take a fresh backup again with moved log device.
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --restore and check the results;
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ij> values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlogmoved',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),14);
+1             
+--------------
+wombatlogmoved
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+30         
+31         
+32         
+33         
+34         
+35         
+ij> insert into t1 values(36);
+1 row inserted/updated/deleted
+ij> insert into t1 values(37);
+1 row inserted/updated/deleted
+ij> insert into t1 values(38);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --simulate OS type copy and then boot(Commented because it does not work in nightlies)
+--connect 'jdbc:derby:dummycondb';
+--call RENAME_FILE('rollForwardBackup', 'wombat', 'wombat.old');
+--call RENAME_FILE(null, 'extinout/mybackup/wombat', 'rollForwardBackup/wombat');
+---disconnect;
+---connect 'jdbc:derby:wombat';
+--Following SHOULD SHOW NULL value.
+--values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice');
+--select * from t1;
+--call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+--     'extinout/mybackup', 1);
+--connect 'jdbc:derby:wombat;shutdown=true';
+--disconnect;
+---createFrom without logDevice specified on URL should have null value.
+connect 'jdbc:derby:tempwombat;createFrom=extinout/mybackup/wombat';
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+30         
+31         
+32         
+33         
+34         
+35         
+ij> insert into t1 values(39);
+1 row inserted/updated/deleted
+ij> insert into t1 values(40);
+1 row inserted/updated/deleted
+ij> insert into t1 values(41);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:tempwombat;shutdown=true';
+ERROR 08006: Database 'tempwombat' shutdown.
+ij> disconnect;
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/tempwombat';
+ij> values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice');
+1                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------
+NULL                                                                                                                            
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> ---Using plain backup mechanism rstore/recreate db using  restoreFrom/createFrom
+connect 'jdbc:derby:wombat';
+ij> call SYSCS_UTIL.SYSCS_DISABLE_LOG_ARCHIVE_MODE(1);
+0 rows inserted/updated/deleted
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+30         
+31         
+32         
+33         
+34         
+35         
+39         
+40         
+41         
+ij> insert into t1 values(42);
+1 row inserted/updated/deleted
+ij> insert into t1 values(43);
+1 row inserted/updated/deleted
+ij> insert into t1 values(44);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE('extinout/mybackup');
+0 rows inserted/updated/deleted
+ij> --following inserted values should not be there
+--when we do restore from the above backup.
+insert into t1 values(45);
+1 row inserted/updated/deleted
+ij> insert into t1 values(46);
+1 row inserted/updated/deleted
+ij> insert into t1 values(47);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+30         
+31         
+32         
+33         
+34         
+35         
+39         
+40         
+41         
+42         
+43         
+44         
+ij> insert into t1 values(45);
+1 row inserted/updated/deleted
+ij> insert into t1 values(46);
+1 row inserted/updated/deleted
+ij> insert into t1 values(47);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE('extinout/mybackup');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> connect 'jdbc:derby:wombatnew;createFrom=extinout/mybackup/wombat';
+ij> select * from t1;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+11         
+12         
+13         
+14         
+15         
+19         
+20         
+21         
+22         
+23         
+24         
+25         
+26         
+27         
+30         
+31         
+32         
+33         
+34         
+35         
+39         
+40         
+41         
+42         
+43         
+44         
+45         
+46         
+47         
+ij> insert into t1 values(48);
+1 row inserted/updated/deleted
+ij> insert into t1 values(49);
+1 row inserted/updated/deleted
+ij> insert into t1 values(50);
+1 row inserted/updated/deleted
+ij> connect 'jdbc:derby:wombatnew;shutdown=true';
+ERROR 08006: Database 'wombatnew' shutdown.
+ij> disconnect;
+ij> --enable the log archive mode again.
+connect 'jdbc:derby:wombat';
+ij> call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> disconnect;
+ij> --NEGATIVE TEST with  RESTORE FLAGS
+-- with createFrom option should give erro on existing database
+connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XBM0J: Directory DBLOCATION/wombat already exists.
+ij> -- specify conflictint attributes; it should fail.
+connect 'jdbc:derby:wombat;create=true;createFrom=extinout/mybackup/wombat';
+ERROR XJ049: Conflicting create attributes specified.
+ij> connect 'jdbc:derby:wombat;create=true;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+ERROR XJ049: Conflicting create attributes specified.
+ij> connect 'jdbc:derby:wombat;create=true;restoreFrom=extinout/mybackup/wombat';
+ERROR XJ049: Conflicting create attributes specified.
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+ERROR XJ081: Conflicting create/restore/recovery attributes specified.
+ij> connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+ERROR XJ081: Conflicting create/restore/recovery attributes specified.
+ij> -- With wrong back up path name it shoud fail.
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=nobackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XBM0Y: Backup database directory nobackup<ps>wombat not found. Please make sure that the specified backup path is right.
+ij> connect 'jdbc:derby:wombat;restoreFrom=nobackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XBM0Y: Backup database directory nobackup<ps>wombat not found. Please make sure that the specified backup path is right.
+ij> connect 'jdbc:derby:wombat2;createFrom=nobackup/wombat';
+ERROR XJ040: Failed to start database 'wombat2', see the next exception for details.
+ERROR XBM0Y: Backup database directory nobackup<ps>wombat not found. Please make sure that the specified backup path is right.
+ij> --Simulate missing files by renaming some files in backup(like a corrupted backup and check 
+--whether we get proper error messages
+--Get a connection because it is required to make any calls in ij 
+connect 'jdbc:derby:wombat2;restoreFrom=extinout/mybackup/wombat';
+ij> call RENAME_FILE('extinout/mybackup/wombat/','service.properties','service.properties.old');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XBM0Q: File extinout<ps>mybackup<ps>wombat<ps>service.properties not found. Please make sure that backup copy is the correct one and it is not corrupted.
+ij> call RENAME_FILE('extinout/mybackup/wombat/','service.properties.old','service.properties');
+0 rows inserted/updated/deleted
+ij> call RENAME_FILE('extinout/mybackup/wombat/','log','log.old');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XSLAS: Log directory extinout<ps>mybackup<ps>wombat<ps>log not found in backup during restore. Please make sure that backup copy is the correct one and it is not corrupted.
+ij> call RENAME_FILE('extinout/mybackup/wombat/','log.old','log');
+0 rows inserted/updated/deleted
+ij> call RENAME_FILE('extinout/mybackup/wombat/','seg0','data.old');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XSDG6: Data segment directory not found in extinout<ps>mybackup<ps>wombat backup during restore. Please make sure that backup copy is the right one and it is not corrupted.
+ij> call RENAME_FILE('extinout/mybackup/wombat/','data.old','seg0');
+0 rows inserted/updated/deleted
+ij> --try error cases with createFrom;if root created is not getting cleaned up,
+--next createFrom call will fail with DBLOCATION/wombat exist error.
+call RENAME_FILE('extinout/mybackup/wombat/','service.properties','service.properties.old');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XBM0Q: File extinout<ps>mybackup<ps>wombat<ps>service.properties not found. Please make sure that backup copy is the correct one and it is not corrupted.
+ij> call RENAME_FILE('extinout/mybackup/wombat/','service.properties.old','service.properties');
+0 rows inserted/updated/deleted
+ij> call RENAME_FILE('extinout/mybackup/wombat/','log','log.old');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XSLAS: Log directory extinout<ps>mybackup<ps>wombat<ps>log not found in backup during restore. Please make sure that backup copy is the correct one and it is not corrupted.
+ij> call RENAME_FILE('extinout/mybackup/wombat/','log.old','log');
+0 rows inserted/updated/deleted
+ij> call RENAME_FILE('extinout/mybackup/wombat/','seg0','data.old');
+0 rows inserted/updated/deleted
+ij> connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+ERROR XJ040: Failed to start database 'wombat', see the next exception for details.
+ERROR XSDG6: Data segment directory not found in extinout<ps>mybackup<ps>wombat backup during restore. Please make sure that backup copy is the right one and it is not corrupted.
+ij> call RENAME_FILE('extinout/mybackup/wombat/','data.old','seg0');
+0 rows inserted/updated/deleted
+ij> drop procedure RENAME_FILE;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/savepointJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,102 @@
+Test savepointJdbc30 starting
+Tests common to DRDA and embedded Cloudscape
+Test1 - no unnamed savepoints allowed if autocommit is true
+Expected Exception is Cannot issue savepoint when autoCommit is on.
+Test1a - no named savepoints allowed if autocommit is true
+Expected Exception is Cannot issue savepoint when autoCommit is on.
+Test2 - Release and reuse a savepoint name
+Test3 - null name not allowed for named savepoints
+Expected Exception is Cannot pass null for savepoint name.
+Test4 - Verify names/ids of named/unnamed savepoints
+Expected Exception is No name for un-named savepoints.
+Expected Exception is No ID for named savepoints.
+Test5a - create two savepoints in two different transactions and release the first one in the subsequent transaction
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test5b - create two savepoints in two different transactions and rollback the first one in the subsequent transaction
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6a - create a savepoint, release it, create another with same name and release the first one
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6b - create a savepoint, release it, create another with same name and rollback the first one
+Expected Exception is SAVEPOINT, s1 does not  exist or is not active in the current transaction.
+Test6c - Try to use a savepoint from another connection for release
+Expected Exception is A RELEASE or ROLLBACK TO SAVEPOINT was specified, but the savepoint does not exist.
+Test7a - swap savepoints across connections with release
+Expected Exception is A RELEASE or ROLLBACK TO SAVEPOINT was specified, but the savepoint does not exist.
+Test7b - swap savepoints across connections with rollback
+Expected Exception is A RELEASE or ROLLBACK TO SAVEPOINT was specified, but the savepoint does not exist.
+Test 9 test savepoint name
+Test 10 test savepoint name case sensitivity
+Test 11 rolling back a savepoint multiple times - should work
+Test 12 releasing a savepoint multiple times - should not work
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 13 shouldn't be able to use a savepoint from earlier transaction after setting autocommit on and off
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 14 A non-user initiated transaction rollback should release the internal savepoint array
+Expected Exception is A lock could not be obtained within the time requested
+Expected Exception is SAVEPOINT, MyName does not  exist or is not active in the current transaction.
+Test 15 check savepoints in batch
+Test 16 grammar check for savepoint sq1
+Expected Exception is Syntax error: MISSING ON ROLLBACK RETAIN CURSORS.
+Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN CURSORS' clause are present.
+Expected Exception is Multiple or conflicting keywords involving the 'ON ROLLBACK RETAIN LOCKS' clause are present.
+Expected Exception is Multiple or conflicting keywords involving the 'UNIQUE' clause are present.
+Test 17 No nested savepoints allowed when using SQL to set savepoints.
+Test 17a Test with UNIQUE clause.
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 17b Test without UNIQUE clause.
+Since no nesting is allowed, skipping UNIQUE still gives error for trying to define another savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 18 No nested SQL savepoints allowed inside JDBC savepoint.
+Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 19 No nested SQL savepoints allowed inside SQL savepoint.
+Following SQL savepoint will fail because we are trying to nest it inside SQL savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Test 20 Rollback of SQL savepoint works same as rollback of JDBC savepoint.
+Test 21 After releasing the SQL savepoint, rollback the transaction and should see everything undone.
+Test 22 Should not be able to create a SQL savepoint starting with name SYS
+Expected Exception is An object cannot be created with the schema name 'SYS'.
+Test 23 Should be able to use non-reserved keywords savepoint and release as identifiers
+Create table with savepoint and release as identifiers
+Create a savepoint with name savepoint
+Release the savepoint with name savepoint
+Create a savepoint with name release
+Rollback to the savepoint with name release
+Release the savepoint with name release
+Test 24 Savepoint name can't exceed 128 characters
+Expected Exception is The name 'MyName1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' is too long. The maximum length is '128'.
+Test 25 Should not be able to create a SQL savepoint starting with name SYS through jdbc
+Expected Exception is An object cannot be created with the schema name 'SYS'.
+Test 26a rollback of null savepoint
+Expected Exception is SAVEPOINT, null does not  exist or is not active in the current transaction.
+Test 26b release  of null savepoint
+Expected Exception is SAVEPOINT, null does not  exist or is not active in the current transaction.
+Next try non-DRDA tests
+Test40 - named savepoint can't conflict with internally generated name for unnamed savepoints
+Test41a - Rollback to a savepoint, then try to release savepoint created after that savepoint
+Expected Exception is SAVEPOINT, s2 does not  exist or is not active in the current transaction.
+Test41b - Rollback to a savepoint, then try to rollback savepoint created after that savepoint
+Expected Exception is SAVEPOINT, s2 does not  exist or is not active in the current transaction.
+Test42 - Rollback/commit the transaction, then try to use savepoint from that transaction
+Expected Exception is SAVEPOINT, SAVEPT5 does not  exist or is not active in the current transaction.
+Expected Exception is SAVEPOINT, SAVEPT6 does not  exist or is not active in the current transaction.
+Test43 - Release and reuse a savepoint name
+Expected Exception is A SAVEPOINT with the passed name already exists in the current transaction.
+Test 45 reuse savepoint name after rollback - should not work
+Expected Exception is A SAVEPOINT with the passed name already exists in the current transaction.
+Test 46 Cursors declared before and within the savepoint unit will be closed when rolling back the savepoint
+Expected Exception is ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Expected Exception is ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Expected Exception is ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Expected Exception is ResultSet not open, operation 'next' not permitted. Verify that autocommit is OFF.
+Test 47 multiple tests for getSavepointId()
+8
+9
+10
+11
+12
+Test 48 No nested SQL savepoints allowed.
+Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint
+Expected Exception is The maximum number of savepoints has been reached. 
+Expected Exception is The maximum number of savepoints has been reached. 
+Test savepointJdbc30 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,649 @@
+ij> -- create some tables
+create table t1(c50 char(50), i int);
+0 rows inserted/updated/deleted
+ij> create table t2(c50 char(50), i int);
+0 rows inserted/updated/deleted
+ij> -- populate tables
+insert into t1 values ('b', 2), ('c', 3), ('d', 4), ('e', 5),
+		      ('f', 6), ('g', 7), ('h', 8), ('i', 9),
+		      ('j', 10), ('k', 11), ('l', 12), ('m', 13);
+12 rows inserted/updated/deleted
+ij> autocommit off;
+ij> -- negative
+-- position on forward only cursor
+get cursor c1 as 'select i from t1';
+ij> getcurrentrownumber c1;
+IJ ERROR: GETCURRENTROWNUMBER is not allowed on a forward only cursor.
+ij> first c1;
+IJ ERROR: FIRST is not allowed on a forward only cursor.
+ij> last c1;
+IJ ERROR: LAST is not allowed on a forward only cursor.
+ij> previous c1;
+IJ ERROR: PREVIOUS is not allowed on a forward only cursor.
+ij> next c1;
+I          
+-----------
+2          
+ij> before first c1;
+IJ ERROR: BEFORE FIRST is not allowed on a forward only cursor.
+ij> after last c1;
+IJ ERROR: AFTER LAST is not allowed on a forward only cursor.
+ij> absolute 1 c1;
+IJ ERROR: ABSOLUTE is not allowed on a forward only cursor.
+ij> relative 1 c1;
+IJ ERROR: RELATIVE is not allowed on a forward only cursor.
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- 0 is invalid value for absolute
+absolute 0 c1;
+IJ ERROR: 0 is an invalid value for ABSOLUTE <integer> <cursorname>
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- relative is invalid when not positioned on a row
+relative 0 c1;
+ERROR X0X87: ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- relative is invalid when not positioned on a row
+relative 2 c1;
+ERROR X0X87: ResultSet.relative(int row) cannot be called when the cursor is not positioned on a row.
+ij> close c1;
+ij> -- positive
+-- test positioning
+get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- 2
+first c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 3
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+c                                                 |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- 2
+first c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 3
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+c                                                 |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- 4
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+d                                                 |4          
+ij> getcurrentrownumber c1;
+3
+ij> -- 2
+first c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 3
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+c                                                 |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- null
+after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- beetle 5509
+-- null
+next c1;
+No current row
+ij> -- beetle 5509
+getcurrentrownumber c1;
+0
+ij> -- beetle 5509
+-- 13
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> -- beetle 5509
+getcurrentrownumber c1;
+12
+ij> -- beetle 5509
+-- 12
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+l                                                 |12         
+ij> -- beetle 5509
+getcurrentrownumber c1;
+11
+ij> -- 13
+last c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- null
+before first c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 2
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 13
+absolute 12 c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- 3
+absolute -11 c1;
+C50                                               |I          
+--------------------------------------------------------------
+c                                                 |3          
+ij> getcurrentrownumber c1;
+2
+ij> -- null
+absolute 13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- null
+absolute -13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- absolute -1 should be last row
+absolute -1 c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+12
+ij> close c1;
+ij> -- do last first
+get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- 13
+last c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- null
+next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+last c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+12
+ij> -- 12
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+l                                                 |12         
+ij> getcurrentrownumber c1;
+11
+ij> -- 2
+first c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> getcurrentrownumber c1;
+1
+ij> -- null
+previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 2
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> getcurrentrownumber c1;
+1
+ij> close c1;
+ij> -- do after last first
+get scroll insensitive cursor c1 as 'select * from t1';
+ij> -- null
+after last c1;
+No current row
+ij> -- 13
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> -- 12
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+l                                                 |12         
+ij> close c1;
+ij> -- go to next to last row, then do next
+get scroll insensitive cursor c1 as 'select * from t1 where i >= 11';
+ij> -- 11
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+k                                                 |11         
+ij> getcurrentrownumber c1;
+1
+ij> -- 12
+next c1;
+C50                                               |I          
+--------------------------------------------------------------
+l                                                 |12         
+ij> getcurrentrownumber c1;
+2
+ij> -- 13
+last c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+3
+ij> -- 12
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+l                                                 |12         
+ij> getcurrentrownumber c1;
+2
+ij> -- null
+after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> close c1;
+ij> -- start at after last
+get scroll insensitive cursor c1 as 'select * from t1 where i >= 11';
+ij> -- null
+after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> getcurrentrownumber c1;
+3
+ij> close c1;
+ij> -- use absolute to get rows before
+-- scan would get to them
+get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- 6
+absolute 5 c1;
+I          
+-----------
+6          
+ij> getcurrentrownumber c1;
+5
+ij> -- 9
+absolute -5 c1;
+I          
+-----------
+9          
+ij> getcurrentrownumber c1;
+8
+ij> -- 6
+absolute 5 c1;
+I          
+-----------
+6          
+ij> getcurrentrownumber c1;
+5
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- null
+absolute 13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+previous c1;
+I          
+-----------
+13         
+ij> getcurrentrownumber c1;
+12
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- null
+absolute -13 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 2
+next c1;
+I          
+-----------
+2          
+ij> getcurrentrownumber c1;
+1
+ij> close c1;
+ij> -- test relative implementation
+get scroll insensitive cursor c1 as 'select i from t1';
+ij> -- 2
+first c1;
+I          
+-----------
+2          
+ij> getcurrentrownumber c1;
+1
+ij> -- 13
+relative 11 c1;
+I          
+-----------
+13         
+ij> getcurrentrownumber c1;
+12
+ij> -- null
+relative 1 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> -- 13
+last c1;
+I          
+-----------
+13         
+ij> getcurrentrownumber c1;
+12
+ij> -- 2
+relative -11 c1;
+I          
+-----------
+2          
+ij> getcurrentrownumber c1;
+1
+ij> close c1;
+ij> -- scroll sensitive cursor becomes scroll insensitive
+commit;
+ij> get scroll sensitive cursor c1 as 'select i from t1';
+ij> first c1;
+I          
+-----------
+2          
+ij> next c1;
+I          
+-----------
+3          
+ij> update t1 set i = 666 where i = 2;
+1 row inserted/updated/deleted
+ij> first c1;
+I          
+-----------
+2          
+ij> rollback;
+ij> -- verify that statement cache works
+-- correctly with scroll and forward only
+-- cursors on same query text
+get scroll insensitive cursor c1 as 'select i from t1';
+ij> get cursor c2 as 'select i from t1';
+ij> first c1;
+I          
+-----------
+2          
+ij> next c2;
+I          
+-----------
+2          
+ij> first c2;
+IJ ERROR: FIRST is not allowed on a forward only cursor.
+ij> close c1;
+ij> close c2;
+ij> -- first, last, etc. on empty result set
+get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> first c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> absolute 1 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> absolute -1 c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> after last c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> previous c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> before first c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> next c1;
+No current row
+ij> getcurrentrownumber c1;
+0
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> absolute 1 c1;
+No current row
+ij> absolute -1 c1;
+No current row
+ij> close c1;
+ij> get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+ij> absolute -1 c1;
+No current row
+ij> absolute 1 c1;
+No current row
+ij> close c1;
+ij> autocommit on;
+ij> get scroll insensitive with hold cursor c1 as 'select i from t1 where 1=0';
+ij> first c1;
+No current row
+ij> first c1;
+No current row
+ij> last c1;
+No current row
+ij> last c1;
+No current row
+ij> absolute 1 c1;
+No current row
+ij> absolute -1 c1;
+No current row
+ij> before first c1;
+No current row
+ij> after last c1;
+No current row
+ij> previous c1;
+No current row
+ij> next c1;
+No current row
+ij> -- beetle 5510
+next c1;
+No current row
+ij> close c1;
+ij> -- cursor on a sort
+get scroll insensitive cursor c1 as 'select * from t1 order by i desc';
+ij> -- 2
+last c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> -- 13
+first c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> -- 2
+relative 11 c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> -- 3
+previous c1;
+C50                                               |I          
+--------------------------------------------------------------
+c                                                 |3          
+ij> close c1;
+ij> -- RTS
+call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+0 rows inserted/updated/deleted
+ij> maximumdisplaywidth 2000;
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> last c1;
+C50                                               |I          
+--------------------------------------------------------------
+m                                                 |13         
+ij> first c1;
+C50                                               |I          
+--------------------------------------------------------------
+b                                                 |2          
+ij> next c1;
+C50                                               |I          
+--------------------------------------------------------------
+c                                                 |3          
+ij> close c1;
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	C1
+Statement Text: 
+	select * from t1
+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: 
+Scroll Insensitive ResultSet:
+Number of opens = 1
+Rows seen = 1
+Number of reads from hash table = 3
+Number of writes to hash table = 12
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+Source result set:
+	Table Scan ResultSet for T1 at read committed isolation level using instantaneous share row locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 12
+	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=2
+		Number of pages visited=1
+		Number of rows qualified=12
+		Number of rows visited=12
+		Scan type=heap
+		start position: 
+null		stop position: 
+null		qualifiers:
+None
+ij> get scroll insensitive cursor c1 as 'select * from t1';
+ij> close c1;
+ij> -- for following set of tests, setting the holdability over commit to false for this connection since that is what we want to test below
+-- Using this rather than passing with nohold to cursor statement because this test also runs in jdk13 and lower and there is no way to
+-- set the holdability using jdbc api in those jdks (unless trying that through a jdbc program where one can use reflection to set holdability
+-- in jdk131)
+NoholdForConnection;
+ij> -- beetle 4551 - insensitive cursor uses estimated row count which might be
+-- pessimistic and will get out of memory error
+create table big(a int generated always as identity (start with 1, increment by 1));
+0 rows inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> insert into big values(default);
+1 row inserted/updated/deleted
+ij> get scroll insensitive cursor s1 as
+'select * from big b1 left outer join  big b2 on b1.a = b2.a left outer join  big b3 on b2.a = b3.a left outer join big b4 on b3.a = b4.a left outer join (big b5 left outer join (big b6 left outer join (big b7 left outer join big b8 on b7.a = b8.a) on b6.a=b7.a) on b5.a = b6.a) on b4.a = b5.a';
+ij> -- clean up
+drop table t1;
+0 rows inserted/updated/deleted
+ij> drop table t2;
+0 rows inserted/updated/deleted
+ij> drop table big;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors2.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors2.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors2.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,15 @@
+Test scrollCurors2 starting
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Scroll sensitive cursors are not currently implemented.
+warning = SQL Warning: Scroll sensitive cursors are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Scroll sensitive cursors are not currently implemented.
+warning = SQL Warning: Scroll sensitive cursors are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+warning = SQL Warning: Updatable ResultSets are not currently implemented.
+PASS
+Test scrollCursors2 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors3.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors3.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors3.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,52 @@
+ij> disconnect;
+ij> connect 'wombat;user=U1' AS C1;
+ij> connect 'wombat;user=U2' AS C2;
+ij(C2)> set connection C1;
+ij(C1)> create table t1(c1 int, c2 int);
+0 rows inserted/updated/deleted
+ij(C1)> insert into t1 values (1, 2), (3, 4), (5, 6), (7, 8), (9, 10);
+5 rows inserted/updated/deleted
+ij(C1)> get scroll insensitive cursor c1 as 'select * from t1';
+ij(C1)> set connection C2;
+ij(C2)> -- see what happens to other user when we close our cursor
+-- before they are done.
+get scroll insensitive cursor c1 as 'select * from U1.t1';
+ij(C2)> set connection C1;
+ij(C1)> next c1;
+C1         |C2         
+-----------------------
+1          |2          
+ij(C1)> set connection C2;
+ij(C2)> next c1;
+C1         |C2         
+-----------------------
+1          |2          
+ij(C2)> set connection C1;
+ij(C1)> last c1;
+C1         |C2         
+-----------------------
+9          |10         
+ij(C1)> set connection C2;
+ij(C2)> last c1;
+C1         |C2         
+-----------------------
+9          |10         
+ij(C2)> set connection C1;
+ij(C1)> previous c1;
+C1         |C2         
+-----------------------
+7          |8          
+ij(C1)> set connection C2;
+ij(C2)> close c1;
+ij(C2)> set connection C1;
+ij(C1)> first c1;
+C1         |C2         
+-----------------------
+1          |2          
+ij(C1)> close c1;
+ij(C1)> drop table t1;
+0 rows inserted/updated/deleted
+ij(C1)> disconnect;
+ij> set connection C2;
+ij> disconnect;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,206 @@
+ij> --
+-- Specifically test SECURE users and various authentication
+-- service/scheme configuration for different databases.
+--
+-- Configure the 6 different databases with for each
+-- of them, a different authentication scheme.
+--
+-- 'wombat'				- default DERBY scheme &
+--						  users known at system level.
+--						  Some authorization restriction.
+-- 'guestSchemeDB'		- No authentication
+-- 'derbySchemeDB'	- BUILTIN authentication
+--						  & some db authorization restriction.
+-- 'simpleSchemeDB'		- BUILTIN authentication and
+--						  some db authorization restriction.
+--                        (was the old Cloudscape 1.5 simple scheme)
+--
+-- let's create all the dbs and configure them.
+-- we will authenticate using a default system user that we
+-- have configured.
+-- A typical bad guy who cannot access any database but guest
+-- is Jamie.
+--
+--
+-- 'guestSchemeDB' database authentication/authorization config
+--
+connect 'guestSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION1)> -- override requireAuthentication to be turned OFF at the database level
+autocommit off;
+ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p1 using 'values(''derby.connection.requireAuthentication'', ''false'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> --
+-- 'derbySchemeDB' database authentication/authorization config
+--
+connect 'derbySchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION2)> autocommit off;
+ij(CONNECTION2)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION2)> execute p2 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> -- let's define users in this database (other than the ones
+-- known at the system level. This is for the test
+-- These 3 users will only be known in this database
+execute p2 using 'values(''derby.user.martin'', ''obfuscateIt'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> execute p2 using 'values(''derby.user.dan'', ''makeItFaster'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> execute p2 using 'values(''derby.user.mamta'', ''ieScape'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> commit;
+ij(CONNECTION2)> autocommit on;
+ij(CONNECTION2)> --
+-- 'simpleSchemeDB' database authentication/authorization config
+--
+connect 'simpleSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION3)> autocommit off;
+ij(CONNECTION3)> prepare p5 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION3)> execute p5 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> --
+--  only allow these 3 users
+execute p5 using 'values(''derby.database.fullAccessUsers'', ''system,jeff,howardR'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> execute p5 using 'values(''derby.database.readOnlyAccessUsers'', ''francois'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> -- no access to Jamie only as he's a well known hooligan
+execute p5 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> commit;
+ij(CONNECTION3)> autocommit on;
+ij(CONNECTION3)> --
+-- Shutdown the system for database properties to take effect
+--
+disconnect all;
+ij> connect 'wombat;user=system;password=manager;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> connect 'guestSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: Database 'guestSchemeDB' shutdown.
+ij> connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'simpleSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: Database 'simpleSchemeDB' shutdown.
+ij> disconnect all;
+ij> -- shuting down the system causes IJ to loose the protocol, therefore
+-- we'd be doomed :(
+#connect ';shutdown=true;user=system;password=manager';
+IJ ERROR: Unable to establish connection
+ij> -- 1) Valid authentication & authorization requests/ops
+-- 
+connect 'wombat;create=true;user=kreg;password=IwasBornReady';
+WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
+ij> connect 'wombat;user=jeff;password=homeRun';
+ij(CONNECTION1)> connect 'wombat;user=howardR;password=takeItEasy';
+ij(CONNECTION2)> connect 'wombat;user=francois;password=paceesalute';
+ij(CONNECTION3)> -- Invalid ones:
+connect 'wombat;user=Jamie;password=theHooligan';
+ij(CONNECTION4)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION2 - 	jdbc:derby:wombat
+CONNECTION3 - 	jdbc:derby:wombat
+CONNECTION4* - 	jdbc:derby:wombat
+* = current connection
+ij(CONNECTION4)> connect 'guestSchemeDB;user=kreg;password=IwasBornReady';
+ij(CONNECTION5)> connect 'guestSchemeDB;user=jeff;password=homeRun';
+ij(CONNECTION6)> connect 'guestSchemeDB;user=howardR;password=takeItEasy';
+ij(CONNECTION7)> connect 'guestSchemeDB;user=francois;password=paceesalute';
+ij(CONNECTION8)> -- Invalid ones:
+connect 'guestSchemeDB;user=Jamie;password=theHooligan';
+ij(CONNECTION9)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION2 - 	jdbc:derby:wombat
+CONNECTION3 - 	jdbc:derby:wombat
+CONNECTION4 - 	jdbc:derby:wombat
+CONNECTION5 - 	jdbc:derby:guestSchemeDB
+CONNECTION6 - 	jdbc:derby:guestSchemeDB
+CONNECTION7 - 	jdbc:derby:guestSchemeDB
+CONNECTION8 - 	jdbc:derby:guestSchemeDB
+CONNECTION9* - 	jdbc:derby:guestSchemeDB
+* = current connection
+ij(CONNECTION9)> connect 'derbySchemeDB;user=mamta;password=ieScape';
+ij(CONNECTION10)> connect 'derbySchemeDB;user=dan;password=makeItFaster';
+ij(CONNECTION11)> connect 'derbySchemeDB;user=martin;password=obfuscateIt';
+ij(CONNECTION12)> -- Invalid ones:
+connect 'derbySchemeDB;user=Jamie;password=theHooligan';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION12)> connect 'derbySchemeDB;user=francois;password=paceesalute';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION12)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION10 - 	jdbc:derby:derbySchemeDB
+CONNECTION11 - 	jdbc:derby:derbySchemeDB
+CONNECTION12* - 	jdbc:derby:derbySchemeDB
+CONNECTION2 - 	jdbc:derby:wombat
+CONNECTION3 - 	jdbc:derby:wombat
+CONNECTION4 - 	jdbc:derby:wombat
+CONNECTION5 - 	jdbc:derby:guestSchemeDB
+CONNECTION6 - 	jdbc:derby:guestSchemeDB
+CONNECTION7 - 	jdbc:derby:guestSchemeDB
+CONNECTION8 - 	jdbc:derby:guestSchemeDB
+CONNECTION9 - 	jdbc:derby:guestSchemeDB
+* = current connection
+ij(CONNECTION12)> connect 'simpleSchemeDB;user=jeff;password=homeRun';
+ij(CONNECTION13)> connect 'simpleSchemeDB;user=howardR;password=takeItEasy';
+ij(CONNECTION14)> connect 'simpleSchemeDB;user=francois;password=paceesalute';
+ij(CONNECTION15)> -- Read-only user
+create table t1 (c1 int);
+ERROR 25503: DDL is not permitted for a read-only connection, user or database.
+ij(CONNECTION15)> -- Invalid ones:
+connect 'simpleSchemeDB;user=Jamie;password=theHooligan';
+ERROR 04501: Database connection refused.
+ij(CONNECTION15)> connect 'simpleSchemeDB;user=dan;password=makeItFaster';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION15)> connect 'simpleSchemeDB;user=francois;password=corsica';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION15)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION10 - 	jdbc:derby:derbySchemeDB
+CONNECTION11 - 	jdbc:derby:derbySchemeDB
+CONNECTION12 - 	jdbc:derby:derbySchemeDB
+CONNECTION13 - 	jdbc:derby:simpleSchemeDB
+CONNECTION14 - 	jdbc:derby:simpleSchemeDB
+CONNECTION15* - 	jdbc:derby:simpleSchemeDB
+CONNECTION2 - 	jdbc:derby:wombat
+CONNECTION3 - 	jdbc:derby:wombat
+CONNECTION4 - 	jdbc:derby:wombat
+CONNECTION5 - 	jdbc:derby:guestSchemeDB
+CONNECTION6 - 	jdbc:derby:guestSchemeDB
+CONNECTION7 - 	jdbc:derby:guestSchemeDB
+CONNECTION8 - 	jdbc:derby:guestSchemeDB
+CONNECTION9 - 	jdbc:derby:guestSchemeDB
+* = current connection
+ij(CONNECTION15)> disconnect all;
+ij> show connections;
+No connections available.
+ij> -- Database shutdown - check user - should fail
+connect 'derbySchemeDB;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> show connections;
+No connections available.
+ij> -- Database shutdown - check user - should succeed
+connect 'wombat;user=jeff;password=homeRun;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> connect 'guestSchemeDB;user=kreg;password=IwasBornReady;shutdown=true';
+ERROR 08006: Database 'guestSchemeDB' shutdown.
+ij> connect 'derbySchemeDB;user=mamta;password=ieScape;shutdown=true';
+ERROR 08006: Database 'derbySchemeDB' shutdown.
+ij> connect 'simpleSchemeDB;user=jeff;password=homeRun;shutdown=true';
+ERROR 08006: Database 'simpleSchemeDB' shutdown.
+ij> show connections;
+No connections available.
+ij> -- Derby system shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> disconnect all;
+ij> -- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: Derby system shutdown.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers1.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsers1.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,41 @@
+ij> --
+-- Negative test for SECURE users. This tries to authenticate against an LDAP
+-- server on a machine which is not accessible/doesn't exist.
+--
+-- 'ldapSchemeDB'		- LDAP authentication (on NT thru LDAP)
+-- let's create the db and configure it.
+-- we will authenticate using a default system user that we have configured.
+--
+-- 'ldapSchemeDB' database authentication/authorization config
+--
+connect 'ldapSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p1 using 'values(''derby.authentication.provider'', ''LDAP'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> -- there is no such machine as noSuchMachine and so the authentication will fail
+execute p1 using 'values(''derby.authentication.server'', ''noSuchMachine:389'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> execute p1 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> -- this is the default search filter
+execute p1 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> --
+-- Shutdown the system for database properties to take effect
+--
+disconnect all;
+ij> connect 'ldapSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: Database 'ldapSchemeDB' shutdown.
+ij> disconnect all;
+ij> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+ERROR 08004: Connection refused : javax.naming.CommunicationException: noSuchMachine:389 [Root exception is java.net.UnknownHostException: noSuchMachine]
+ij> show connections;
+No connections available.
+ij> disconnect all;
+ij> -- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: Derby system shutdown.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsersldap.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsersldap.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/secureUsersldap.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,230 @@
+ij> --
+-- Specifically test SECURE users with ldap 
+-- Configure the ldap databases, plus some for reference
+--
+-- 'derbySchemeDB'	- BUILTIN authentication
+--						  & some db authorization restriction.
+-- 'ldapSchemeDB'		- LDAP authentication
+--						  (or NT thru LDAP)
+-- 'ldapSchemeDBJN'	- LDAP setting url through java.naming.*
+--						  some db authorization restriction.
+--
+-- let's create all the dbs and configure them.
+-- we will authenticate using a default system user that we
+-- have configured.
+-- A typical bad guy who cannot access any database but guest
+-- is Jamie.
+--
+--
+-- 'derbySchemeDB' database authentication/authorization config
+--
+connect 'derbySchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p2 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> -- let's define users in this database (other than the ones
+-- known at the system level. This is for the test
+-- These 3 users will only be known in this database
+execute p2 using 'values(''derby.user.martin'', ''obfuscateIt'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> execute p2 using 'values(''derby.user.dan'', ''makeItFaster'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> execute p2 using 'values(''derby.user.mamta'', ''ieScape'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> --
+-- 'ldapSchemeDB' database authentication/authorization config
+--
+connect 'ldapSchemeDB;create=true;user=system;password=manager';
+ij(CONNECTION2)> autocommit off;
+ij(CONNECTION2)> prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION2)> execute p3 using 'values(''derby.authentication.provider'', ''LDAP'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> execute p3 using 'values(''derby.authentication.server'', ''thehost.opensource.apache.com:389'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> execute p3 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> -- this is the default search filter
+execute p3 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION2)> commit;
+ij(CONNECTION2)> autocommit on;
+ij(CONNECTION2)> connect 'ldapSchemeDBJN;create=true;user=system;password=manager';
+ij(CONNECTION3)> autocommit off;
+ij(CONNECTION3)> prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION3)> execute p3 using 'values(''derby.authentication.provider'', ''LDAP'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> execute p3 using 'values(''java.naming.provider.url'', ''ldap://thehost.opensource.apache.com:389'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> execute p3 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> -- this is the default search filter
+execute p3 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION3)> commit;
+ij(CONNECTION3)> autocommit on;
+ij(CONNECTION3)> disconnect;
+ij> --
+-- Shutdown the system for database properties to take effect
+--
+disconnect all;
+ij> connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'ldapSchemeDB;user=system;password=manager;shutdown=true';
+ERROR 08006: Database 'ldapSchemeDB' shutdown.
+ij> connect 'ldapSchemeDBJN;user=system;password=manager;shutdown=true';
+ERROR 08006: Database 'ldapSchemeDBJN' shutdown.
+ij> disconnect all;
+ij> -- shuting down the system causes IJ to loose the protocol, therefore
+-- we'd be doomed :(
+#connect ';shutdown=true;user=system;password=manager';
+IJ ERROR: Unable to establish connection
+ij> -- 1) Valid authentication & authorization requests/ops
+connect 'derbySchemeDB;user=mamta;password=ieScape';
+ij> connect 'derbySchemeDB;user=dan;password=makeItFaster';
+ij(CONNECTION1)> connect 'derbySchemeDB;user=martin;password=obfuscateIt';
+ij(CONNECTION2)> -- Invalid ones:
+connect 'derbySchemeDB;user=Jamie;password=theHooligan';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION2)> connect 'derbySchemeDB;user=francois;password=paceesalute';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:derbySchemeDB
+CONNECTION1 - 	jdbc:derby:derbySchemeDB
+CONNECTION2* - 	jdbc:derby:derbySchemeDB
+* = current connection
+ij(CONNECTION2)> --
+-- 1rst test phase for LDAP
+-- We look-up the user DN and authenticate to LDAP with passed-in
+-- credentials
+connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+ij(CONNECTION3)> connect 'ldapSchemeDB;user=francois;password=corsica';
+ij(CONNECTION4)> -- Invalid ones:
+connect 'ldapSchemeDB;user=Jamie;password=theHooligan';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION4)> connect 'ldapSchemeDB;user=dan;password=makeItFaster';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION4)> -- wrong ldap password
+connect 'ldapSchemeDB;user=francois;password=paceesalute';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION4)> show connections;
+CONNECTION0 - 	jdbc:derby:derbySchemeDB
+CONNECTION1 - 	jdbc:derby:derbySchemeDB
+CONNECTION2 - 	jdbc:derby:derbySchemeDB
+CONNECTION3 - 	jdbc:derby:ldapSchemeDB
+CONNECTION4* - 	jdbc:derby:ldapSchemeDB
+* = current connection
+ij(CONNECTION4)> --
+-- 2nd test phases for LDAP - Cache the User DN locally
+-- to avoid the initial look-up
+--
+connect 'ldapSchemeDB;user=francois;password=corsica';
+ij(CONNECTION5)> autocommit off;
+ij(CONNECTION5)> prepare p5 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION5)> execute p5 using 'values(''derby.authentication.ldap.searchFilter'', ''derby.user'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION5)> -- set the users DN locally now
+execute p5 using 'values(''derby.user.mamta'', ''uid=mamta,ou=People,o=opensource.apache.com'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION5)> execute p5 using 'values(''derby.user.francois'', ''uid=francois,ou=People,o=opensource.apache.com'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION5)> show connections;
+CONNECTION0 - 	jdbc:derby:derbySchemeDB
+CONNECTION1 - 	jdbc:derby:derbySchemeDB
+CONNECTION2 - 	jdbc:derby:derbySchemeDB
+CONNECTION3 - 	jdbc:derby:ldapSchemeDB
+CONNECTION4 - 	jdbc:derby:ldapSchemeDB
+CONNECTION5* - 	jdbc:derby:ldapSchemeDB
+* = current connection
+ij(CONNECTION5)> commit;
+ij(CONNECTION5)> autocommit on;
+ij(CONNECTION5)> -- restart ldapSchemeDB for properties to take effect & reconnect to test
+connect 'ldapSchemeDB;user=francois;password=corsica;shutdown=true';
+ERROR 08006: Database 'ldapSchemeDB' shutdown.
+ij(CONNECTION5)> -- re-test
+connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+ij(CONNECTION6)> connect 'ldapSchemeDB;user=francois;password=corsica';
+ij(CONNECTION7)> -- 2a) Some users with no local DN: rachael, kathy
+--     as no local DN cached, look-up will be performed with
+--     default search filter.
+--
+connect 'ldapSchemeDB;user=kathy;password=kathyS';
+ij(CONNECTION8)> connect 'ldapSchemeDB;user=rachael;password=rachaelF';
+ij(CONNECTION9)> show connections;
+CONNECTION0 - 	jdbc:derby:derbySchemeDB
+CONNECTION1 - 	jdbc:derby:derbySchemeDB
+CONNECTION2 - 	jdbc:derby:derbySchemeDB
+CONNECTION6 - 	jdbc:derby:ldapSchemeDB
+CONNECTION7 - 	jdbc:derby:ldapSchemeDB
+CONNECTION8 - 	jdbc:derby:ldapSchemeDB
+CONNECTION9* - 	jdbc:derby:ldapSchemeDB
+* = current connection
+ij(CONNECTION9)> -- Invalid ones:
+connect 'ldapSchemeDB;user=Jamie;password=theHooligan';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION9)> connect 'ldapSchemeDB;user=dan;password=makeItFaster';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION9)> -- wrong ldap password
+connect 'ldapSchemeDB;user=francois;password=paceesalute';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION9)> show connections;
+CONNECTION0 - 	jdbc:derby:derbySchemeDB
+CONNECTION1 - 	jdbc:derby:derbySchemeDB
+CONNECTION2 - 	jdbc:derby:derbySchemeDB
+CONNECTION6 - 	jdbc:derby:ldapSchemeDB
+CONNECTION7 - 	jdbc:derby:ldapSchemeDB
+CONNECTION8 - 	jdbc:derby:ldapSchemeDB
+CONNECTION9* - 	jdbc:derby:ldapSchemeDB
+* = current connection
+ij(CONNECTION9)> -- Database shutdown - check user - should fail
+connect 'derbySchemeDB;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION9)> connect 'ldapSchemeDB;user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION9)> show connections;
+CONNECTION0 - 	jdbc:derby:derbySchemeDB
+CONNECTION1 - 	jdbc:derby:derbySchemeDB
+CONNECTION2 - 	jdbc:derby:derbySchemeDB
+CONNECTION6 - 	jdbc:derby:ldapSchemeDB
+CONNECTION7 - 	jdbc:derby:ldapSchemeDB
+CONNECTION8 - 	jdbc:derby:ldapSchemeDB
+CONNECTION9* - 	jdbc:derby:ldapSchemeDB
+* = current connection
+ij(CONNECTION9)> -- Database shutdown - check user - should succeed
+connect 'derbySchemeDB;user=mamta;password=ieScape;shutdown=true';
+ERROR 08006: Database 'derbySchemeDB' shutdown.
+ij(CONNECTION9)> connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap;shutdown=true';
+ERROR 08006: Database 'ldapSchemeDB' shutdown.
+ij(CONNECTION9)> show connections;
+No current connection
+ij> -- Derby system shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> disconnect all;
+ij> --
+-- 1rst test phase for LDAP
+-- We look-up the user DN and authenticate to LDAP with passed-in
+-- credentials
+connect 'ldapSchemeDBJN;user=mamta;password=yeeHaLdap';
+ij> connect 'ldapSchemeDBJN;user=francois;password=corsica';
+ij(CONNECTION1)> -- Invalid ones:
+connect 'ldapSchemeDBJN;user=Jamie;password=theHooligan';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION1)> connect 'ldapSchemeDBJN;user=dan;password=makeItFaster';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION1)> -- wrong ldap password
+connect 'ldapSchemeDBJN;user=francois;password=paceesalute';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION1)> show connections;
+CONNECTION0 - 	jdbc:derby:ldapSchemeDBJN
+CONNECTION1* - 	jdbc:derby:ldapSchemeDBJN
+* = current connection
+ij(CONNECTION1)> disconnect all;
+ij> -- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: Derby system shutdown.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc20.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,27 @@
+Test statementJdbc20 starting
+PASS -- expected exception
+SQLSTATE(XJ065): SQL Exception: Invalid parameter value '-1,000' for Statement.setFetchSize(int rows).
+PASS -- expected exception
+SQLSTATE(XJ064): SQL Exception: Invalid parameter value '-1,000' for setFetchDirection(int direction).
+Fetch Size 25
+Fetch Direction 1001
+1 2 3.1
+Result Set Fetch Size 25
+Result Set Fetch Direction 1001
+PASS -- expected exception
+SQLSTATE(XJ061): SQL Exception: The 'setFetchDirection()' method is only allowed on scroll cursors.
+Result Set Fetch Size 250
+Result Set Fetch Direction 1001
+PASS -- expected exception
+SQLSTATE(XJ062): SQL Exception: Invalid parameter value '100' for ResultSet.setFetchSize(int rows).
+PASS -- expected exception
+SQLSTATE(XJ062): SQL Exception: Invalid parameter value '-2,000' for ResultSet.setFetchSize(int rows).
+PASS -- expected exception
+SQLSTATE(XJ061): SQL Exception: The 'setFetchDirection()' method is only allowed on scroll cursors.
+PASS -- expected exception
+SQLSTATE(X0Y78): SQL Exception: Statement.executeQuery() cannot be called with a statement that returns a row count.
+PASS -- expected exception
+SQLSTATE(42X05): SQL Exception: Table 'TRASH' does not exist.
+PASS -- expected exception
+SQLSTATE(X0Y79): SQL Exception: Statement.executeUpdate() cannot be called with a statement that returns a ResultSet.
+Test statementJdbc20 finished

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/statementJdbc30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,19 @@
+Test statementJdbc30 starting
+trying stmt.getMoreResults(int) :
+trying stmt.executeUpdate(String, int) :
+trying stmt.executeUpdate(String, int[]) :
+PASS -- expected exception
+SQLSTATE(0A000): SQL Exception: Feature not implemented: executeUpdate(String, int[]).
+trying stmt.executeUpdate(String, String[]) :
+PASS -- expected exception
+SQLSTATE(0A000): SQL Exception: Feature not implemented: executeUpdate(String, String[]).
+trying stmt.execute(String, int) :
+trying stmt.execute(String, int[]) :
+PASS -- expected exception
+SQLSTATE(0A000): SQL Exception: Feature not implemented: execute(String, int[]).
+trying stmt.execute(String, String[]) :
+PASS -- expected exception
+SQLSTATE(0A000): SQL Exception: Feature not implemented: execute(String, String[]).
+trying stmt.getResultSetHoldability() :
+trying stmt.getGeneratedKeys() :
+Test statementJdbc30 finished

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache0.out	Tue Jan 11 11:53:57 2005
@@ -7,7 +7,7 @@
 -----------
 0          
 ij> CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> autocommit off;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/stmtCache1.out	Tue Jan 11 11:53:57 2005
@@ -7,7 +7,7 @@
 autocommit off;
 ij> -- set up aliases
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> CREATE PROCEDURE EC()

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/streamingColumn.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,101 @@
+Test streamingColumn starting
+===> testing extin/short.data length = 56
+No truncation and hence no error
+===> testing extin/shortbanner length = 8282
+No truncation and hence no error
+===> testing extin/derby.banner length = 414000
+expected exception for data > 32700 in length
+===> testing extin/empty.data length = 0
+No truncation and hence no error
+===> verified length 56
+===> verified length 8282
+===> verified length 0
+===> verified length 56
+===> verified length 8282
+===> verified length 0
+===> verified length 56
+===> verified length 8282
+===> verified length 0
+===> verified length 56
+===> verified length 8282
+===> verified length 0
+expect to get null string back
+a = -1 got null string back
+a = -1 got null string back
+===> testing extin/short.data length = 56
+===> testing extin/shortbanner length = 8282
+===> testing extin/derby.banner length = 414000
+===> testing extin/empty.data length = 0
+streamTest7
+Starting streamTest8(conn, 10, 2500)
+Finishing streamTest8(conn, 10, 2500)
+Starting streamTest9(conn, 10, 2500)
+Finishing streamTest9(conn, 10, 2500)
+Starting streamTest8(conn, 2500, 10)
+Finishing streamTest8(conn, 2500, 10)
+Starting streamTest9(conn, 2500, 10)
+Finishing streamTest9(conn, 2500, 10)
+Testing 10 starts from here
+===> testing extin/short.data length = 56
+No truncation and hence no error
+===> testing extin/shortbanner length = 8282
+No truncation and hence no error
+===> testing extin/derby.banner length = 414000
+expected exception for data > 32700 in length
+===> testing extin/empty.data length = 0
+No truncation and hence no error
+Testing 10 ends in here
+Test 11 - Can't pass negative length as the stream length for various setXXXStream methods
+===> testing using setAsciiStream with -2 as length
+PASS -- expected exception:SQL Exception: Input stream cannot have negative length.
+===> testing using setCharacterStream with -1 as length
+PASS -- expected exception:SQL Exception: Input stream cannot have negative length.
+===> testing using setBinaryStream with -1 as length
+PASS -- expected exception:SQL Exception: Input stream cannot have negative length.
+Test 11 - negative stream length tests end in here
+Test 12 - varchar truncation tests start from here
+===> testing(using setAsciiStream) extin/char32675trailingblanks.data length = 32675
+No truncation and hence no error
+===> testing(using setCharacterStream) extin/char32675trailingblanks.data length = 32675
+No truncation and hence no error
+===> testing trailing blanks(using setString) length = 32675
+No truncation and hence no error
+===> testing trailing blanks(using setObject) length = 32675
+No truncation and hence no error
+===> testing trailing blanks using concatenation
+No truncation and hence no error.
+===> testing(using setAsciiStream) extin/char32675.data length = 32675
+expected exception for data > 32672 in length
+===> testing(using setCharacterStream) extin/char32675.data length = 32675
+expected exception for data > 32672 in length
+===> testing trailing non-blanks(using setString) length = 32675
+expected exception for data > 32672 in length
+===> testing trailing non-blanks(using setObject) length = 32675
+expected exception for data > 32672 in length
+===> testing trailing non-blank characters using concatenation
+expected exception for data > 32672 in length
+===> verified length 32672
+===> verified length 32672
+===> verified length 32672
+===> verified length 32672
+===> verified length 32672
+Test 12 - varchar truncation tests end in here
+Test 13 - long varchar truncation tests start from here
+===> testing(using setAsciiStream) extin/char32703trailingblanks.data length = 32703
+expected exception for data > 32700 in length
+===> testing(using setCharacterStream) extin/char32703trailingblanks.data length = 32703
+expected exception for data > 32700 in length
+===> testing trailing blanks(using setString) length = 32703
+expected exception for data > 32700 in length
+===> testing trailing blanks(using setObject) length = 32703
+expected exception for data > 32700 in length
+===> testing(using setAsciiStream) extin/char32703.data length = 32703
+expected exception for data > 32700 in length
+===> testing(using setCharacterStream) extin/char32703.data length = 32703
+expected exception for data > 32700 in length
+===> testing trailing non-blanks(using setString) length = 32703
+expected exception for data > 32700 in length
+===> testing trailing non-blanks(using setObject) length = 32703
+expected exception for data > 32700 in length
+Test 13 - long varchar truncation tests end in here
+Test streamingColumn finished

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out	Tue Jan 11 11:53:57 2005
@@ -3,7 +3,7 @@
 --
 autocommit off;
 ij> CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> autocommit off;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.out?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.out&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.out&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery2.out	Tue Jan 11 11:53:57 2005
@@ -2,7 +2,7 @@
 -- subquery tests (ANY and ALL subqueries)
 --
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 0 rows inserted/updated/deleted
 ij> autocommit off;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocks.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocks.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocks.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,30452 @@
+ij> -- Very basic single user testing of update row locking.
+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> autocommit off;
+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> commit;
+ij> -- READ COMMITTED TEST
+set current isolation read committed;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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           |(1,9)     |GRANT|ACTIVE  
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(4,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> 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 which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(4,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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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 * 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- REPEATABLE READ TEST
+--   should be the same as SERIALIZABLE results except no previous key locks.
+set isolation rs;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- SERIALIZABLE TEST
+set isolation serializable;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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|TABLE   |1   |X   |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  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> delete from a where a = 5;
+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   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |X   |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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |X   |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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+	-- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> 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 which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> 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 which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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|TABLE   |1   |X   |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  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> delete from a where a = 5;
+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   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |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     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |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     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> 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 which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> 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 which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- READ UNCOMMITTED TEST (for update tests should act just like read committed).
+set isolation read uncommitted;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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           |(1,9)     |GRANT|ACTIVE  
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(1,10)    |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |300        |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                            
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                           
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatecursorlocks.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(4,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> 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 which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(4,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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updatesetlocks.subsql';
+ij> -- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+3 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+0 rows inserted/updated/deleted
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+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 * 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |five                                                                                                                           &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a set a=33,b=3030,c='threethree' where 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> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeCursorLocks.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- non cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeSetLocks.subsql';
+ij> -- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+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           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+5          
+6          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+2 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   |2   |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  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+0 rows inserted/updated/deleted
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where 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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |300        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+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     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> update a  set b = -b where a = 2;
+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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a > 0 and b < -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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+2 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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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  
+APP     |UserTran|ROW     |1   |X   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a > 2 and a < 5;
+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           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |-50        |five                                                                                                                           &|index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+update a  set b = 3030 where a > 2 and a < 5;
+1 row inserted/updated/deleted
+ij> delete from a where a = 5;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |3   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |three                                                                                                                          &|index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocksJDBC30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocksJDBC30.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatelocksJDBC30.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,15996 @@
+ij> -- Very basic single user testing of update row locking.
+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> 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> commit;
+ij> -- READ COMMITTED TEST
+set isolation read committed;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateholdcursorlocksJDBC30.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,12)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,13)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    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 int, c varchar(1900));
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateholdcursorlocksJDBC30.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(4,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> 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 which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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           |(4,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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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 a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) );
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) );
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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> 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 which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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> 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 a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- REPEATABLE READ TEST
+--   should be the same as SERIALIZABLE results except no previous key locks.
+set isolation RS;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column  c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateholdcursorlocksJDBC30.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,12)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,8)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,13)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,13)    |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    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 int, c varchar(1900));
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateholdcursorlocksJDBC30.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) );
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) );
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- SERIALIZABLE TEST
+set isolation serializable;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+-- cursor, no index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateholdcursorlocksJDBC30.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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|TABLE   |1   |X   |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  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |X   |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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    create table a(a int, b int);
+0 rows inserted/updated/deleted
+ij> alter table a add column c varchar(1900);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, 'one');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, 'two');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, 'three');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, 'four');
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, 'five');
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, 'six');
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, 'seven');
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+2          |20         |two                                                                                                                             
+3          |30         |three                                                                                                                           
+4          |40         |four                                                                                                                            
+5          |50         |five                                                                                                                            
+6          |60         |six                                                                                                                             
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+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> 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                             
+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> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                            
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                             
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-3000      |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                           
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |30         |three                                                                                                                           
+5          |50         |five                                                                                                                            
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                            
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                           
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+3          
+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> next scan_cursor;
+A          
+-----------
+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   |X   |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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                             
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+5          |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,11)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,11)    |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+-- cursor, no index run
+    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 int, c varchar(1900));
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateholdcursorlocksJDBC30.subsql';
+ij> -- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+2          |20         |two                                                                                                                            &
+3          |30         |three                                                                                                                          &
+4          |40         |four                                                                                                                           &
+5          |50         |five                                                                                                                           &
+6          |60         |six                                                                                                                            &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+3          |30         |three                                                                                                                          &
+5          |50         |five                                                                                                                           &
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+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> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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> 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   |X   |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   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+7          |70         |seven                                                                                                                          &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-3         |-30        |-three                                                                                                                          
+ij> update a set a=3,b=30,c='three' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+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|TABLE   |1   |X   |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  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+-5         |-50        |-five                                                                                                                           
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 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   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+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|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+-5         |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+33         |3030       |threethree                                                                                                                      
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(600) );
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+1 row inserted/updated/deleted
+ij> create unique index a_idx on a (a, index_pad);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> -- cursor, non-unique index run
+    drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> create table a (a int, b int, c varchar(1900), index_pad varchar(700) );
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+1 row inserted/updated/deleted
+ij> insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+1 row inserted/updated/deleted
+ij> insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+1 row inserted/updated/deleted
+ij> insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+1 row inserted/updated/deleted
+ij> insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+1 row inserted/updated/deleted
+ij> insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+1 row inserted/updated/deleted
+ij> insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+1 row inserted/updated/deleted
+ij> create index a_idx on a (a, index_pad);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+ij> -- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+autocommit off;
+ij> --------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+2          |20         |two                                                                                                                            &|index pad 2                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+4          |40         |four                                                                                                                           &|index pad 4                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+6          |60         |six                                                                                                                            &|index pad 6                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+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> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |20         |two                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+4          |40         |four                                                                                                                           &
+ij> delete from a where current of scan_cursor;
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |5   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+6          |60         |six                                                                                                                            &
+ij> delete from a where current of scan_cursor;
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |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   |7   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(6,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select a from a;
+A          
+-----------
+1          
+3          
+5          
+7          
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-3000 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-3000      |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-3000      |three                                                                                                                          &
+ij> update a set b=30 where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |30         |three                                                                                                                          &|index pad 3                                                                                                                    &
+5          |50         |five                                                                                                                           &|index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                          &
+ij> update a set b=-30,c='-three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |50         |five                                                                                                                           &
+ij> update a set b=-50,c='-five' where current of scan_cursor;
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+7          |70         |seven                                                                                                                          &
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+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          
+-----------
+3          
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          
+-----------
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |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  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(6,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(7,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+1          |10         |one                                                                                                                            &|index pad 1                                                                                                                    &
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+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          
+-----------
+1          
+ij> delete from a where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |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   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(1,7)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+7          |70         |seven                                                                                                                          &|index pad 7                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+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> next scan_cursor;
+A          
+-----------
+7          
+ij> delete from a where current of scan_cursor;
+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|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |-30        |-three                                                                                                                          
+ij> update a set b=30,c='three' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+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   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |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   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+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> commit;
+ij> select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           |index pad 3                                                                                                                    &
+5          |-50        |-five                                                                                                                           |index pad 5                                                                                                                    &
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+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          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |30         |three                                                                                                                           
+ij> update a set b=3030,c='threethree' where current of scan_cursor;
+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   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          |C                                                                                                                               
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |-50        |-five                                                                                                                           
+ij> delete from a where current of scan_cursor;
+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   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |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     |2   |X   |A           |(5,6)     |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   |4   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(5,6)     |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     |2   |X   |A           |(5,6)     |GRANT|ACTIVE  
+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> commit;
+ij> -------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+A          |B          |C                                                                                                                               |INDEX_PAD                                                                                                                       
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+3          |3030       |threethree                                                                                                                      |index pad 3                                                                                                                    &
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,152 @@
+ij> --
+connect 'wombat;create=true;user=dan;password=MakeItFaster';
+WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p1 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> execute p1 using 'values(''derby.database.fullAccessUsers'', ''francois,jeff,howardR,ames,kreg'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> remove p1;
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> disconnect;
+ij> connect 'wombat;shutdown=true;user=francois;password=paceesalute';
+ERROR 08006: Database 'wombat' shutdown.
+ij> connect 'myDB;create=true;user=dan;password=MakeItFaster';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij(CONNECTION1)> execute p2 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> execute p2 using 'values(''derby.database.fullAccessUsers'', ''jerry,kreg,dan,jamie,ames,francois'')';
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> remove p2;
+ij(CONNECTION1)> commit;
+ij(CONNECTION1)> autocommit on;
+ij(CONNECTION1)> disconnect;
+ij> connect 'myDB;shutdown=true;user=dan;password=MakeItFaster';
+ERROR 08006: Database 'myDB' shutdown.
+ij> -- beetle 5468
+disconnect all;
+ij> -- Specifically test JBMS users.
+--
+-- check allowed users in wombat db.
+connect 'wombat;user=kreg;password=visualWhat?';
+ij> connect 'wombat;user=jeff;password=HomeRun61';
+ij(CONNECTION1)> connect 'wombat;user=ames;password=AnyVolunteer?';
+ij(CONNECTION2)> connect 'wombat;user=howardR;password=IamBetterAtTennis';
+ij(CONNECTION3)> connect 'wombat;user=francois;password=paceesalute';
+ij(CONNECTION4)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION2 - 	jdbc:derby:wombat
+CONNECTION3 - 	jdbc:derby:wombat
+CONNECTION4* - 	jdbc:derby:wombat
+* = current connection
+ij(CONNECTION4)> disconnect all;
+ij> -- check allowed users in myDB db.
+-- also check USER flavors
+connect 'myDB;user=jerry;password=SacreBleu';
+ij> create table APP.t1(c1 char(30) check (UPPER(c1) <> 'JAMIE'));
+0 rows inserted/updated/deleted
+ij> insert into APP.t1 values CURRENT_USER;
+1 row inserted/updated/deleted
+ij> connect 'myDB;user=kreg;password=visualWhat?';
+ij(CONNECTION1)> insert into APP.t1 values USER;
+1 row inserted/updated/deleted
+ij(CONNECTION1)> connect 'myDB;user=ames;password=AnyVolunteer?';
+ij(CONNECTION2)> insert into APP.t1 values SESSION_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION2)> connect 'myDB;user=dan;password=MakeItFaster';
+ij(CONNECTION3)> select * from APP.t1;
+C1                            
+------------------------------
+JERRY                         
+KREG                          
+AMES                          
+ij(CONNECTION3)> update APP.t1 set c1 = {fn user() };
+3 rows inserted/updated/deleted
+ij(CONNECTION3)> select * from APP.t1;
+C1                            
+------------------------------
+DAN                           
+DAN                           
+DAN                           
+ij(CONNECTION3)> connect 'myDB;user=francois;password=paceesalute';
+ij(CONNECTION4)> update APP.t1 set c1 = USER;
+3 rows inserted/updated/deleted
+ij(CONNECTION4)> connect 'myDB;user=jamie;password=MrNamePlates';
+ij(CONNECTION5)> select * from APP.t1;
+C1                            
+------------------------------
+FRANCOIS                      
+FRANCOIS                      
+FRANCOIS                      
+ij(CONNECTION5)> update APP.t1 set c1 = USER;
+ERROR 23513: The check constraint 'xxxxGENERATED-IDxxxx' was violated while performing an INSERT or UPDATE on table 'APP.T1'.
+ij(CONNECTION5)> show connections;
+CONNECTION0 - 	jdbc:derby:myDB
+CONNECTION1 - 	jdbc:derby:myDB
+CONNECTION2 - 	jdbc:derby:myDB
+CONNECTION3 - 	jdbc:derby:myDB
+CONNECTION4 - 	jdbc:derby:myDB
+CONNECTION5* - 	jdbc:derby:myDB
+* = current connection
+ij(CONNECTION5)> disconnect all;
+ij> --
+-- some negative cases
+--
+-- Invalid login's
+connect 'wombat';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=badUser1;password=YeeHa!';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=badUser2;password=YeeHa!';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'myDB;user=dan;password=MakeItSlower';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'myDB;user=jamie;password=LetMeIn';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=francois;password=Corsica';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> -- Invalid database users
+connect 'myDB;user=howardR;password=IamBetterAtTennis';
+ERROR 04501: Database connection refused.
+ij> connect 'wombat;user=jerry;password=SacreBleu';
+ERROR 04501: Database connection refused.
+ij> connect 'wombat;user=jamie;password=MrNamePlates';
+ERROR 04501: Database connection refused.
+ij> show connections;
+No connections available.
+ij> connect 'wombat;user=francois;password=paceesalute';
+ij> connect 'myDB;user=jerry;password=SacreBleu';
+ij(CONNECTION1)> -- Database shutdown - check user - should fail
+connect 'myDB;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION1)> connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION1)> connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 04501: Database connection refused.
+ij(CONNECTION1)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1* - 	jdbc:derby:myDB
+* = current connection
+ij(CONNECTION1)> -- Database shutdown - check user - should succeed
+-- beetle 5367
+connect 'wombat;user=francois;password=paceesalute;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij(CONNECTION1)> connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 08006: Database 'myDB' shutdown.
+ij(CONNECTION1)> show connections;
+No current connection
+ij> -- JBMS System shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> disconnect all;
+ij> -- JBMS System shutdown - check user - should succeed
+connect ';user=francois;password=paceesalute;shutdown=true';
+ERROR XJ015: Derby system shutdown.
+ij> -- beetle 5390
+-- the server does not shut down properly in network server
+;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users2.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users2.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/users2.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,241 @@
+ij> --
+-- Specifically test Derby users using DERBY scheme
+-- and by only looking at database properties for authentication
+-- The only user at the system level is system/manager
+--
+-- check allowed users in wombat db.
+-- initial connection in sysprop was:
+-- connect 'wombat;create=true;user=system;password=manager';
+--
+-- Default to: derby.authentication.provider=BUILTIN
+--
+autocommit off;
+ij> prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p1 using 'values(''derby.connection.requireAuthentication'', ''true'')';
+0 rows inserted/updated/deleted
+ij> commit;
+ij> remove p1;
+ij> autocommit on;
+ij> disconnect all;
+ij> connect 'wombat;shutdown=true;user=system;password=manager';
+ERROR 08006: Database 'wombat' shutdown.
+ij> -- beetle 5468
+disconnect all;
+ij> connect 'wombat;user=system;password=manager';
+ij> --
+-- set authentication config for 'wombat' database
+--
+autocommit off;
+ij> prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p2 using 'values(''derby.user.kreg'', ''visualWhat?'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.user.jeff'', ''HomeRun61'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.user.ames'', ''AnyVolunteer?'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.user.jamie'', ''MrNamePlates'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.user.howardR'', ''IamBetterAtTennis'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.user.francois'', ''paceesalute'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.database.fullAccessUsers'', ''jeff,howardR,ames,francois,kreg'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.database.readOnlyAccessUsers'', ''jamie'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+0 rows inserted/updated/deleted
+ij> execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+0 rows inserted/updated/deleted
+ij> commit;
+ij> autocommit on;
+ij> -- Check that the passwords are encrypted
+-- values getDatabaseProperty('derby.user.francois');
+-- values getDatabaseProperty('derby.user.ames');
+-- values getDatabaseProperty('derby.user.kreg');
+-- values getDatabaseProperty('derby.user.jeff');
+-- values getDatabaseProperty('derby.user.howardR');
+-- values getDatabaseProperty('derby.user.jamie');
+connect 'wombat;user=kreg;password=visualWhat?';
+ij(CONNECTION1)> connect 'wombat;user=jeff;password=HomeRun61';
+ij(CONNECTION2)> connect 'wombat;user=ames;password=AnyVolunteer?';
+ij(CONNECTION3)> connect 'wombat;user=howardR;password=IamBetterAtTennis';
+ij(CONNECTION4)> -- should succeed
+create table APP.t1(c1 char(30));
+0 rows inserted/updated/deleted
+ij(CONNECTION4)> insert into APP.t1 values CURRENT_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION4)> connect 'wombat;user=jamie;password=MrNamePlates';
+ij(CONNECTION5)> -- should fail as readOnly user
+insert into APP.t1 values CURRENT_USER;
+ERROR 25502: An SQL data change is not permitted for a read-only connection, user or database.
+ij(CONNECTION5)> create table APP.t2(c1 char(30));
+ERROR 25503: DDL is not permitted for a read-only connection, user or database.
+ij(CONNECTION5)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION2 - 	jdbc:derby:wombat
+CONNECTION3 - 	jdbc:derby:wombat
+CONNECTION4 - 	jdbc:derby:wombat
+CONNECTION5* - 	jdbc:derby:wombat
+* = current connection
+ij(CONNECTION5)> disconnect all;
+ij> -- check allowed users in myDB db.
+--
+connect 'myDB;create=true;user=system;password=manager';
+ij> autocommit off;
+ij> prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p3 using 'values(''derby.connection.requireAuthentication'', ''true'')';
+0 rows inserted/updated/deleted
+ij> remove p3;
+ij> autocommit on;
+ij> disconnect all;
+ij> connect 'myDB;shutdown=true;user=system;password=manager';
+ERROR 08006: Database 'myDB' shutdown.
+ij> -- beetle 5468
+disconnect all;
+ij> connect 'myDB;user=system;password=manager';
+ij> --
+-- set authentication config for 'myDB' database
+--
+autocommit off;
+ij> prepare p4 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+ij> execute p4 using 'values(''derby.user.kreg'', ''visualWhat?'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.user.dan'', ''MakeItFaster'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.user.ames'', ''AnyVolunteer?'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.user.jerry'', ''SacreBleu'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.user.jamie'', ''MrNamePlates'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.user.francois'', ''paceesalute'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.database.fullAccessUsers'', ''jerry,dan,kreg,ames,francois,jamie'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+0 rows inserted/updated/deleted
+ij> execute p4 using 'values(''derby.database.propertiesOnly'', ''true'')';
+0 rows inserted/updated/deleted
+ij> commit;
+ij> autocommit on;
+ij> -- Check that the passwords are encrypted
+-- values getDatabaseProperty('derby.user.francois');
+-- values getDatabaseProperty('derby.user.ames');
+-- values getDatabaseProperty('derby.user.kreg');
+-- values getDatabaseProperty('derby.user.dan');
+-- values getDatabaseProperty('derby.user.jerry');
+-- values getDatabaseProperty('derby.user.jamie');
+--
+-- also check USER flavors
+--
+connect 'myDB;user=jerry;password=SacreBleu';
+ij(CONNECTION1)> create table APP.t1(c1 char(30) check (UPPER(c1) <> 'JAMIE'));
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> insert into APP.t1 values CURRENT_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION1)> connect 'myDB;user=kreg;password=visualWhat?';
+ij(CONNECTION2)> insert into APP.t1 values USER;
+1 row inserted/updated/deleted
+ij(CONNECTION2)> connect 'myDB;user=ames;password=AnyVolunteer?';
+ij(CONNECTION3)> insert into APP.t1 values SESSION_USER;
+1 row inserted/updated/deleted
+ij(CONNECTION3)> connect 'myDB;user=dan;password=MakeItFaster';
+ij(CONNECTION4)> select * from APP.t1;
+C1                            
+------------------------------
+JERRY                         
+KREG                          
+AMES                          
+ij(CONNECTION4)> update APP.t1 set c1 = USER;
+3 rows inserted/updated/deleted
+ij(CONNECTION4)> select * from APP.t1;
+C1                            
+------------------------------
+DAN                           
+DAN                           
+DAN                           
+ij(CONNECTION4)> connect 'myDB;user=francois;password=paceesalute';
+ij(CONNECTION5)> update APP.t1 set c1 = USER;
+3 rows inserted/updated/deleted
+ij(CONNECTION5)> connect 'myDB;user=jamie;password=MrNamePlates';
+ij(CONNECTION6)> select * from APP.t1;
+C1                            
+------------------------------
+FRANCOIS                      
+FRANCOIS                      
+FRANCOIS                      
+ij(CONNECTION6)> update APP.t1 set c1 = USER;
+ERROR 23513: The check constraint 'xxxxGENERATED-IDxxxx' was violated while performing an INSERT or UPDATE on table 'APP.T1'.
+ij(CONNECTION6)> show connections;
+CONNECTION0 - 	jdbc:derby:myDB
+CONNECTION1 - 	jdbc:derby:myDB
+CONNECTION2 - 	jdbc:derby:myDB
+CONNECTION3 - 	jdbc:derby:myDB
+CONNECTION4 - 	jdbc:derby:myDB
+CONNECTION5 - 	jdbc:derby:myDB
+CONNECTION6* - 	jdbc:derby:myDB
+* = current connection
+ij(CONNECTION6)> disconnect all;
+ij> --
+-- some negative cases
+--
+-- Invalid login's
+connect 'wombat';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=badUser1;password=YeeHa!';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=badUser2;password=YeeHa!';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'myDB;user=dan;password=MakeItSlower';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'myDB;user=jamie;password=LetMeIn';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=francois;password=Corsica';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> -- Invalid database users
+connect 'myDB;user=howardR;password=IamBetterAtTennis';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=jerry;password=SacreBleu';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> connect 'wombat;user=jamie;password=MrNamePlates';
+ij> show connections;
+CONNECTION0* - 	jdbc:derby:wombat
+* = current connection
+ij> connect 'wombat;user=francois;password=paceesalute';
+ij(CONNECTION1)> connect 'myDB;user=jerry;password=SacreBleu';
+ij(CONNECTION2)> -- Database shutdown - check user - should fail
+connect 'myDB;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION2)> connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION2)> connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij(CONNECTION2)> show connections;
+CONNECTION0 - 	jdbc:derby:wombat
+CONNECTION1 - 	jdbc:derby:wombat
+CONNECTION2* - 	jdbc:derby:myDB
+* = current connection
+ij(CONNECTION2)> disconnect all;
+ij> show connections;
+No connections available.
+ij> -- Database shutdown - check user - should succeed
+connect 'wombat;user=francois;password=paceesalute;shutdown=true';
+ERROR 08006: Database 'wombat' shutdown.
+ij> -- beetle 5468
+disconnect all;
+ij> connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
+ERROR 08006: Database 'myDB' shutdown.
+ij> -- beetle 5468
+disconnect all;
+ij> -- there should be no connections left here
+show connections;
+No connections available.
+ij> -- JBMS System shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+ERROR 08004: Connection refused : Invalid authentication.
+ij> -- JBMS System shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+ERROR XJ015: Derby system shutdown.
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaJNDI.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaJNDI.out?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaJNDI.out	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2 @@
+SUCCESS:The 2 data sources are same
+SUCCESS:The 2 data sources are different

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties	Tue Jan 11 11:53:57 2005
@@ -1,3 +1,3 @@
-suites=derbylang derbynetmats storeall xa derbytools
+suites=derbylang derbynetmats storeall xa derbytools jdbc20 jdk14 jdbcapi
 derby.debug.true=enableBtreeConsistencyCheck
 derby.stream.error.logSeverityLevel=0

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbytools.runall	Tue Jan 11 11:53:57 2005
@@ -1 +1,13 @@
 tools/dblook_test.java
+tools/importExport.java
+tools/importExportThruIJ.sql
+tools/ieptests.sql
+tools/iepnegativetests.sql
+tools/ij.sql
+tools/ij2.sql
+tools/ij3.sql
+tools/ij4.sql
+tools/ij5.sql
+tools/ij6.sql
+tools/ijConnName.sql
+tools/URLCheck.sql

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2 @@
+jdk12test=true
+runwithj9=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc20.runall	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+lang/scrollCursors1.sql
+lang/scrollCursors2.java
+lang/scrollCursors3.sql
+jdbcapi/batchUpdate.java
+jdbcapi/metadataJdbc20.java
+jdbcapi/getCurConnJdbc20.sql
+jdbcapi/statementJdbc20.java
+jdbcapi/connectionJdbc20.java
+jdbcapi/StmtCloseFunTest.java
+jdbcapi/resultsetJdbc20.java

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,13 @@
+jdbcapi/bestrowidentifier.sql
+jdbcapi/characterStreams.java
+jdbcapi/nullSQLText.java
+jdbcapi/prepStmtMetaData.java
+jdbcapi/resultset.java
+jdbcapi/resultsetStream.java
+jdbcapi/users.sql
+jdbcapi/users2.sql
+jdbcapi/secureUsers.sql
+jdbcapi/secureUsers1.sql
+jdbcapi/maxfieldsize.java
+jdbcapi/LOBTest.java
+jdbcapi/blobclob4BLOB.java

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+jdk14test=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdk14.runall	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+jdbcapi/autoGeneratedJdbc30.java
+jdbcapi/dbMetaDataJdbc30.java
+lang/holdCursorJava.java
+jdbcapi/checkDataSource30.java
+jdbcapi/parameterMetaDataJdbc30.java
+lang/procedureJdbc30.java
+jdbcapi/resultsetJdbc30.java
+jdbcapi/statementJdbc30.java
+jdbcapi/savepointJdbc30.java
+store/bootLock.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/noDerbyNet.runall	Tue Jan 11 11:53:57 2005
@@ -1 +1,8 @@
- 
+# excluding resultsetStream.java because this test uses java.io.FileInputStream throughout the test
+# excluding scrollCursors2.java because updatable resultsets & scroll sensitive cursors are not supported
+# excluding batchUpdate.java for it hits a problem in networkserver ('beetle' 5561)
+# excluding statementJdbc20.java because this tests fetch_reverse throughout the test
+jdbcapi/resultsetStream.java
+lang/scrollCursors2.java
+jdbcapi/batchUpdate.java
+jdbcapi/statementJdbc20.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall	Tue Jan 11 11:53:57 2005
@@ -1,5 +1,6 @@
+store/RowLockBasic.sql
+store/TableLockBasic.sql
 store/access.sql
 store/longColumn.sql
 store/madhare.sql
-store/RowLockBasic.sql
-store/TableLockBasic.sql
+store/streamingColumn.java

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall	Tue Jan 11 11:53:57 2005
@@ -1,5 +1,6 @@
 store/cisco.sql
 store/connectDisconnect.sql
+store/databaseProperties.sql
 store/longRow.sql
 store/logDevice.sql
 store/Rllmodule1.sql
@@ -16,8 +17,13 @@
 store/heapscan.sql
 store/removeStubs.sql
 store/lockTableVti.sql
+store/rollForwardBackup.sql
 store/rollForwardRecovery.sql
+store/readlocks.sql
 store/backupRestore.sql
+store/backupRestore1.java
+store/bootLock.java
 store/bug3498.sql
+store/Beetle6038.java
 store/holdCursorJDBC30.sql
 store/holdCursorExternalSortJDBC30.sql

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall	Tue Jan 11 11:53:57 2005
@@ -1,3 +1,4 @@
+jdbcapi/checkDataSource.java
 jdbcapi/dataSourcePermissions.java
 jdbcapi/xaAnotherTest.sql
 jdbcapi/xaSimplePositive.sql

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access1.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access1.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access1.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+1,7,3,"Exercise Bike","Deluxe","KK200","1234ABCDDDD1234",1993-02-06,0:00:00,"Clock Tower Sporting Goods",200.00,100.00,1,
+2,3,1,"Gray three-cushion sofa","70"" sleeper",,,1975-04-01,0:00:00,"The Sofa Gallery",600.00,,1,
+3,7,6,"Mountain Bike",,,,1993-08-12,0:00:00,"Crawford & Sons Custom Bicycles",1239.00,1000.00,1,
+4,6,4,"Computer","375","1089","00001",,,"ByteComp, Inc.",3000.00,2500.00,0,
+5,5,6,"Cordless drill","Deluxe","PK200","XXX8373220",1993-08-18,0:00:00,"Costoso, Ltd.",2000.00,1250.00,1,
+6,3,5,"Ebony inlaid table",,,,1990-04-1,0:00:00,,250.00,,1,"Handed down from Grandma. Belonged to her mother."
+7,5,6,"Table saw",,"BKV100","BKV9832355",,,,,110.00,0,"Belonged to Dad."
+8,2,4,"Baseball card collection",,,,,,,,500.00,0,"Most were trades. Most valuable card in collection."
+9,4,3,"Pearl neclace",,,,1990-05-01,0:00:00,,,250.00,1,"Gift from Lee and Martha."
+10,6,1,"Audio-Visual Receiver",,"AV-520","AVZZZ98333257",1994-10-10,0:00:00,"Southridge Video Shop",800.00,,1,

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access2.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access2.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access2.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+1          7          3          Exercise Bike                                                                                                                                                                                                                                                  Deluxe                                            KK200                                             1234ABCDDDD1234                                   1993-02-06Clock Tower Sporting Goods                         200.00               100.00              true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
+2          3          1          Gray three-cushion sofa                                                                                                                                                                                                                                        70" sleeper                                                                                                                                           1975-04-01The Sofa Gallery                                   600.00                                   true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
+3          7          6          Mountain Bike                                                                                                                                                                                                                                                                                                                                                                                                        1993-08-12Crawford & Sons Custom Bicycles                    1239.00              1000.00             true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
+4          6          4          Computer                                                                                                                                                                                                                                                       375                                               1089                                              00001                                                       ByteComp, Inc.                                     3000.00              2500.00             false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
+5          5          6          Cordless drill                                                                                                                                                                                                                                                 Deluxe                                            PK200                                             XXX8373220                                        1993-08-18Costoso, Ltd.                                      2000.00              1250.00             false                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
+6          3          5          Ebony inlaid table                                                                                                                                                                                                                                                                                                                                                                                                   1990-04-01                                                   250.00                                   falseHanded down from Grandma. Belonged to her mother.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+7          5          6          Table saw                                                                                                                                                                                                                                                                                                        BKV100                                            BKV9832355                                                                                                                          110.00              falseBelonged to Dad.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
+8          2          4          Baseball card collection                                                                                                                                                                                                                                                                                                                                                                                                                                                                               500.00              falseMost were trades. Most valuable card in collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
+9          4          3          Pearl neclace                                                                                                                                                                                                                                                                                                                                                                                                        1990-05-01                                                                        250.00              true Gift from Lee and Martha.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
+10         6          1          Audio-Visual Receiver                                                                                                                                                                                                                                                                                            AV-520                                            AVZZZ98333257                                     1994-10-10Southridge Video Shop                              800.00                                   true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access3.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access3.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Access3.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+1,7,3,'Exercise Bike','Deluxe','KK200','1234ABCDDDD1234',1993-02-06 0:00:00,'Clock Tower Sporting Goods',200.00,100.00,1,
+2,3,1,'Gray three-cushion sofa','70" sleeper','',,1975-04-01 0:00:00,'The Sofa Gallery',600.00,,1,
+3,7,6,'Mountain Bike','',,,1993-08-12 0:00:00,'Crawford & Sons Custom Bicycles',1239.00,1000.00,1,
+4,6,4,'Computer','375','1089','00001',,'ByteComp, Inc.',3000.00,2500.00,0,
+5,5,6,'Cordless drill','Deluxe','PK200','XXX8373220',1993-08-18 0:00:00,'Costoso, Ltd.',2000.00,1250.00,1,
+6,3,5,'Ebony inlaid table',,,,1990-04-01 0:00:00,,250.00,,1,'Handed down from Grandma. Belonged to her mother.'
+7,5,6,'Table saw',,'BKV100','BKV9832355',,,,110.00,1,'Belonged to Dad.'
+8,2,4,'Baseball card collection',,,,,,,500.00,1,'Most were trades. Most valuable card in collection.'
+9,4,3,'Pearl neclace',,,,1990-05-01 0:00:00,,,250.00,1,'Gift from Lee and Martha.'
+10,6,1,'Audio-Visual Receiver',,'AV-520','AVZZZ98333257',1994-10-10 0:00:00,'Southridge Video Shop',800.00,,1,

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt1.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt1.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt1.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+(10000)	(Bugs)	(Bunny)	 (Warner Brothers)	 (  -- Rabbit Hole -- )	 (Los Angeles)	(CA)	(94001)	(0.0)	(100.00),(10019)	(Bobbi)	(Arndt)	(Market Place)	(1000 S Nicolet Rd)	(Sametown)	(TX)	(99136-1221)	(100.00)	(218.00),(10023)	(Bruce)	(Beecher)	(Madson & Huth Communication Co)	(1037 W Wisconsin Ave)	(Smithville)	(AK)	(99140-1599)	(120.00)	(222.00),(10024)	(Bruce)	(Beyer)	(La Salle Clinic)	(108 E Wisconsin Ave)	(Jonestown)	(AK)	(99143-1803)	(125.00)	(223.00),(10025)	(Butch)	(Bobbi)	(Town & Country Electric Inc.)	(108 Hillock Ct)	(Smithville)	(AK)	(99166-3208)	(130.00)	(224.00),(10026)	(Calla)	(Boshers)	(Saturn of Appleton)	(110 Fox River Dr)	(Smithville)	(AK)	(99166-3425)	(135.00)	(225.00),(10027)	(Carol)	(Brauer)	(Bemiss Corp.)	(110 W North Water St)	(Jonestown)	(AK)	(99216-1144)	(140.00)	(226.00),(10028)	(Carol)	(Braun)	(AAL Member Credit Union)	(1115 E Glendale Ave)	(Smithville)	(AK)	(99311-5715)	(145.00)	(227.00),(10029)	(Cheri)	(Buksyk)	(Office Support)	(1122 Milwaukee St)	(Jonestown)	(AK)	(99401-4175)	(150.00)	(228.00),(10030)	(Chuck)	(Buss)	(EAA)	(1134 S Franklin St)	(Overton)	(AK)	(99401-9903)	(155.00)	(229.00),(10031)	(Chuck)	(Carpenter)	(Kurz Electric)	(115 S Drew St)	(Smithville)	(AK)	(99433-9418)	(160.00)	(230.00),(10032)	(Chuck)	(Carr)	(Alpha 1)	(1151 Valley Fair Mall)	(Jonestown)	(AK)	(99451)	(165.00)	(231.00),(10034)	(Colleen)	(Casperson)	(Valley Trust Corporation)	(120 N Morrison St)	(Smithville)	(AK)	(99501)	(175.00)	(233.00),(10035)	(Connie)	(Catterton)	(Fox Community Credit Union)	(1200 N Perkins St)	(Smithville)	(AK)	(99901)	(180.00)	(234.00),(10036)	(Connie)	(Clay)	(Valley Lawn Care)	(121 N Douglas St # R)	(Smithville)	(AK)	(99901)	(185.00)	(235.00),(10037)	(Craig)	(Collar)	(Network Health Plan)	(1216 W Wisconsin Ave)	(Moretown)	(AK)	(99901)	(190.00)	(236.00),(10038)	(Dan)	(Coppenger)	(Kolosso Toyota)	(1221 N Lawe St)	(Smithville)	(AK)	(99901-2104)	(195.00)	(237.00),(10039)	(Dan)	(Dag)	(AAL)	(1222 N Superior St)	(Smithville)	(AK)	(99901-2990)	(200.00)	(238.00),(10040)	(Darlene)	(Dantzier)	(WDFF)	(124 W Wisconsin Ave)	(Dime Box)	(AK)	(99901-4848)	(205.00)	(239.00),(10041)	(Darlene)	(Dellenmann)	(AAL)	(130 E Franklin St)	(Smithville)	(AK)	(99901-7140)	(210.00)	(240.00),(10042)	(Darren)	(Dinkl)	(Novus Health Group)	(1300 E Calumet St)	(Smithville)	(AK)	(99903-2099)	(215.00)	(241.00),(10043)	(David)	(Dockry)	(AAL)	(1302 S Ritger)	(Smithville)	(AK)	(99903-2692)	(220.00)	(242.00),(10044)	(Debra)	(Dorsey)	(AAL Capital Management)	(1320 S Lincoln St)	(Smithville)	(AK)	(99903-3065)	(225.00)	(243.00),(10045)	(Denise)	(Richardson)	(AAL Printing/Distribution)	(1396 Ridgeway Court)	(Smithville)	(AK)	(99911)	(230.00)	(244.00),(10046)	(Diane)	(Duginski)	(Lawrence University)	(144 N Mall Dr)	(Smithville)	(AK)	(99911)	(235.00)	(245.00),(10047)	(Dick)	(Dunbar)	(Ken Gibson Assoc.)	(1461 Ashland Ave)	(Smithville)	(AK)	(99911)	(240.00)	(246.00),(10048)	(Dinah)	(Duxbury)	(Menasha Employees Credit Union)	(1486 Earl St)	(Dime Box)	(AK)	(99911)	(245.00)	(247.00),(10049)	(Dominic)	(Earl)	(UPIU)	(150 W Green Bay Rd)	(Lonesome)	(AK)	(99911)	(250.00)	(248.00),(10050)	(Don)	(Ely)	(AAL)	(1620 S Lawe St)	(Smithville)	(AK)	(99911)	(255.00)	(249.00),(10052)	(Donna)	(Erdmann)	(Fox Valley Technical College)	(1737 W Reid Dr)	(Smithville)	(AK)	(99911)	(265.00)	(251.00),(10053)	(Donna)	(Esser)	(Bergstrom Air Force Base)	(1801 N Richmond St # 12)	(Jonestown)	(AK)	(99911)	(270.00)	(252.00),(10054)	(Duane)	(Feavel)	(Bank One)	(1818 N Meade St)	(Smithville)	(AK)	(99911-1995)	(275.00)	(253.00),(10055)	(Emmett)	(Forseth)	(Bergstrom Enterprises)	(1818 N Meade St)	(Smithville)	(AK)	(99911-2781)	(280.00)	(254.00),(10056)	(Erik)	(Francken)	(Fox Cities Bank)	(1825 N Bluemound Dr)	(Jonestown)	(AK)	(99911-3045)	(285.00)	(255.00),(10057)	(Father)	(Freitas)	(Town of Vandenbroek)	(1825 N Bluemound Dr)	(Smithville)	(AK)	(99911-3144)	(290.00)	(256.00),(10058)	(Gary)	(Garvey)	(Kitz Printing)	(1909 W 2nd St)	(Overton)	(AK)	(99911-3499)	(295.00)	(257.00),(10060)	(George)	(Gibson)	(Prime Control Systems)	(1965 Oshkosh Ave)	(Smithville)	(AK)	(99911-4397)	(305.00)	(259.00),(10061)	(Glenn)	(Gorman)	(Van Vreede's)	(1990 S Van Dyke Rd)	(Little Gorge)	(AK)	(99911-4708)	(310.00)	(260.00),(10062)	(Howard)	(Grennon)	(Insurance Brokerage Services)	(200 W College Ave)	(Smithville)	(AK)	(99911-4721)	(315.00)	(261.00),(10063)	(Ingrid)	(Guyette)	(Fox Valley Travel)	(2074 American Dr)	(Overton)	(AK)	(99911-4828)	(320.00)	(262.00),(10064)	(Jacquie)	(Hagen)	(M & M Advertising)	(21 Waugoo Ave)	(Smithville)	(AK)	(99911-9972)	(325.00)	(263.00),(10065)	(James)	(Hammer)	(University of Women)	(212 E College Ave)	(Overton)	(AK)	(99911-9979)	(330.00)	(264.00),(10066)	(Jan)	(Hanks)	(YMCA)	(213 Paul Dr)	(Jonestown)	(AK)	(99911-5712)	(335.00)	(265.00),(10067)	(Jane)	(Haugner)	(O'Donnell Publishing)	(217 Pacific St)	(Jonestown)	(AK)	(99911-5713)	(340.00)	(266.00),(10068)	(Jeff)	(Henneman)	(Western Ice)	(218 E Lawrence St)	(Smithville)	(AK)	(99911-5713)	(345.00)	(267.00),(10069)	(Jeff)	(Holland)	(Four D Corporation)	(2181 W Wisconsin Ave)	(Appleton)	(TX)	(99911-5724)	(350.00)	(268.00),(10070)	(Jim)	(Hoppe)	(Andrews Mautner	 Inc.)	(221 E Atlantic St)	(Moosetown)	(AK)	(99911-5735)	(355.00)	(269.00),(10071)	(Jim)	(Howard)	(Laser Typesetting)	(221 W College Ave)	(Smithville)	(AK)	(99911-5770)	(360.00)	(270.00),(10072)	(Jim)	(Ick)	(Wallach & Assoc.)	(222 E College Ave)	(Smithville)	(AK)	(99911-5798)	(365.00)	(271.00),(10073)	(Jim)	(Issacson)	(Town of Grand River)	(222 E College Ave)	(Smithville)	(AK)	(99911-5827)	(370.00)	(272.00),(10074)	(Jo Ann)	(Jahnke)	(Cabelvision)	(225 Main St Box # 8003)	(Smithville)	(AK)	(99911-5862)	(375.00)	(273.00),(10075)	(Joanne)	(Jensen)	(Print & Mail	 Inc.)	(2301 W Nordale Dr)	(Smithville)	(AK)	(99911-9106)	(380.00)	(274.00),(10076)	(Jodi)	(Jesse)	(Jewelers Mutual Insurance)	(231 E College Ave)	(Jonestown)	(AK)	(99912-0235)	(385.00)	(275.00),(10077)	(Joe)	(Jirtle)	(Burton Karstedt)	(2320 S Memorial Dr)	(Dime Box)	(AK)	(99912-0386)	(390.00)	(276.00),(10079)	(John)	(Johnson)	(Twin City Rod & Gun Club)	(250 Industrial Drive)	(Jonestown)	(AK)	(99912-1073)	(400.00)	(278.00),(10080)	(John)	(Kamp)	(American Legion)	(2600 Stewart Ave # 22)	(Smithville)	(AK)	(99913)	(405.00)	(279.00),(10081)	(John)	(Karstedt)	(TechLine)	(2662 American Dr)	(Smithville)	(AK)	(99913-1697)	(410.00)	(280.00),(10082)	(John)	(Kitz)	(Data One Computer Service)	(2820 N Roemer Rd)	(Smithville)	(AK)	(99913-1936)	(415.00)	(281.00),(10083)	(John)	(Kolberg)	(Appleton Area School District)	(292 Ohio St)	(Smithville)	(AK)	(99913-2019)	(420.00)	(282.00),(10084)	(John)	(Korth)	(Banta Corporate)	(3000 W Wisconsin Ave)	(Dime Box)	(AK)	(99913-2798)	(425.00)	(283.00),(10085)	(John)	(Kotarek)	(HRC Inc.)	(3012 Greenview Dr)	(Jonestown)	(AK)	(99914)	(430.00)	(284.00),(10086)	(Joyce)	(Kretsch)	(Phopar)	(3036 W Wisconsin Ave)	(Smithville)	(AK)	(99914-1347)	(435.00)	(285.00),(10087)	(Judy)	(Kuehl)	(Sutherland Electric)	(3090 Oregon St)	(Smithville)	(AK)	(99914-1426)	(440.00)	(286.00),(10088)	(Katie)	(Kusserow)	(Banta Credit Union)	(310 Appleton St)	(Dime Box)	(AK)	(99914-1483)	(445.00)	(288.00),(10089)	(Kay)	(Lambert)	(Uffenbeck Diamonds)	(319 Main St)	(Smithville)	(AK)	(99914-1698)	(450.00)	(289.00),(10090)	(Ken)	(Lamb)	(Equitable Reserve Association)	(32122 Paseo Adelanto Ste 2B)	(Jonestown)	(AK)	(99914-1698)	(455.00)	(290.00),(10091)	(Kevin)	(Lensby)	(Derksen Printing)	(3218 Timothy Ln #6)	(Overton)	(AK)	(99914-1737)	(460.00)	(291.00),(10092)	(Larry)	(Lesperance)	(Custom Printing)	(322 N Commercial St)	(Smithville)	(AK)	(99914-1888)	(465.00)	(292.00),(10093)	(Larry)	(Lindberg)	(Faye's Fine Jewelry)	(3232 N Ballard Rd)	(Jonestown)	(AK)	(99914-3121)	(470.00)	(293.00),(10094)	(Linda)	(Linonofski)	(Haugners Inc.)	(33 Park Pl)	(Smithville)	(AK)	(99914-3136)	(475.00)	(294.00),(10095)	(Linda)	(Long)	(Pyramid Marketing & Advertising)	(3301 W Prospect Ave)	(Smithville)	(AK)	(99914-3169)	(480.00)	(295.00),(10097)	(Liz)	(Lonsway)	(Wisconsin Tissue Credit Union)	(333 W College Ave)	(Jonestown)	(AK)	(99914-3599)	(490.00)	(297.00),(10098)	(Lon)	(Lowe)	(AAL)	(342 W Wisconsin Ave)	(Smithville)	(AK)	(99914-3566)	(495.00)	(298.00),(10099)	(Lori)	(Ludwig)	(Pat Woods Inc)	(3730 W College Ave)	(Kimbro)	(AK)	(99914-3920)	(500.00)	(299.00),(10100)	(Luke)	(Madison)	(Creative Learning International)	(375 Byrd Ave)	(Jonestown)	(AK)	(99914-3975)	(505.00)	(301.00),(10101)	(Mark)	(Mancl)	(United Health)	(3992 N Richmond St)	(Smithville)	(AK)	(99914-3989)	(510.00)	(302.00),(10102)	(Mark)	(Melissa)	(Memorial Florists)	(408 W Wisconsin Ave)	(Smithville)	(AK)	(99914-4698)	(515.00)	(303.00),(10103)	(Marlene)	(Mentink)	(Fay Hawkinson & Kruse Inc)	(411 Lincoln St)	(Overton)	(AK)	(99914-5175)	(520.00)	(304.00),(10104)	(Marti)	(Merryfield)	(Enterprise Motors)	(419 N Oneida St)	(Smithville)	(AK)	(99914-5230)	(525.00)	(305.00),(10105)	(Marty)	(Meyere)	(Weidert Group Inc)	(420 E Longville Dr)	(Smithville)	(AK)	(99915)	(530.00)	(306.00),(10106)	(Mary)	(Micke)	(Principal Financial)	(4301 W Wisconsin Ave)	(Smithville)	(AK)	(99915)	(535.00)	(307.00),(10107)	(Mary)	(Mohr)	(Woodfield Suites)	(4321 N Ballard Rd)	(Smithville)	(AK)	(99915)	(540.00)	(308.00),(10108)	(Mary)	(Mortensen)	(Master Litho)	(4321 N Ballard Rd)	(Jonestown)	(AK)	(99915-1429)	(545.00)	(309.00),(10109)	(Mary)	(Mueller)	(Rawhide Boys Ranch)	(4321 N Ballard Rd)	(New Hope)	(AK)	(99915-1488)	(550.00)	(310.00),(10110)	(Mary)	(Mugerauer)	(Ad Works)	(4321 N Ballard Rd)	(Smithville)	(AK)	(99915-2241)	(555.00)	(311.00),(10111)	(Mary)	(Novak)	(Directions Inc)	(4321 N Ballard Rd)	(Jonestown)	(AK)	(99915-2401)	(560.00)	(312.00),(10112)	(Mary Beth)	(O'Donnell)	(Counseling Resource Center)	(4321 N Ballard Rd)	(Smithville)	(AK)	(99915-2421)	(565.00)	(313.00),(10113)	(Mary)	(Pannabaker)	(World Wide Auto Parts)	(4321 W College Ave)	(Smithville)	(AK)	(99915-9951)	(570.00)	(314.00),(10114)	(Michelle)	(Pawlowski)	(Secura Insurance)	(4406 W Spencer St)	(Smithville)	(AK)	(99915-9986)	(575.00)	(315.00),(10115)	(Mike)	(Peter)	(Witthuhn Printing)	(4895 Integrity Way)	(Smithville)	(AK)	(99915-7802)	(580.00)	(316.00),(10116)	(Mike)	(Peters)	(St Mary's Central High School)	(502 W Northland Ave)	(Dime Box)	(AK)	(99915-8299)	(585.00)	(317.00),(10117)	(Mike)	(Phillips)	(Valley Periodontics)	(517 N Appleton St)	(Smithville)	(AK)	(99915-8288)	(590.00)	(319.00),(10118)	(Nancy)	(Rapp)	(Neenah Printing)	(520 E Wisconsin Ave)	(Jonestown)	(AK)	(99915-8410)	(595.00)	(320.00),(10119)	(Nancy)	(Rasmussen)	(YMCA of Appleton)	(520 E Wisconsin Ave)	(Smithville)	(AK)	(99915-8734)	(600.00)	(321.00),(10120)	(Nancy)	(Rathman)	(Appleton Medical Center)	(525 Enterprise Dr)	(Smithville)	(AK)	(99915-8897)	(605.00)	(322.00),(10121)	(Nancy)	(Reinl)	(Quinlan Dentistry)	(525 N Perkins St)	(Smithville)	(AK)	(99915-9010)	(610.00)	(323.00),(10122)	(Natalie)	(Reynolds)	(Klusendorf Chiropractic)	(528 2nd St)	(Smithville)	(AK)	(99915-9106)	(615.00)	(324.00),(10123)	(Pam)	(Richeson)	(Drucks Plumbing)	(531 N Main St)	(Dime Box)	(AK)	(99915-9108)	(620.00)	(325.00),(10124)	(Pat)	(Robbins)	(Market Link)	(557 S Marcella St)	(Smithville)	(AK)	(99915-9210)	(625.00)	(326.00),(10125)	(Pat)	(Roberts)	(Norandex)	(610 E Wisconsin Ave)	(Smithville)	(AK)	(99915-9295)	(630.00)	(327.00),(10126)	(Peg)	(Russel)	(Appleton Camping)	(675 Brighton Beach Rd)	(Smithville)	(AK)	(99915-9701)	(635.00)	(328.00),(10129)	(Mickey)	(Mouse)	(Disneyland)	(Magic Kingdom)	(Los Angeles)	(CA)	(94000)	(0.00)	(1.00),

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt2.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt2.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt2.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,101 @@
+     10000Bugs      Bunny     Warner Brothers                NULL                       Los Angeles CA   94001         0.00 1000.00
+     10019Bobbi     Arndt     Market Place                   1000 S Nicolet Rd          Sametown    TX   99136-1221  100.00  218.00
+     10023Bruce     Beecher   Madson & Huth Communication Co 1037 W Wisconsin Ave       Smithville  AK   99140-1599  120.00  222.00
+     10024Bruce     Beyer     La Salle Clinic                108 E Wisconsin Ave        Jonestown   AK   99143-1803  125.00  223.00
+     10025Butch     Bobbi     Town & Country Electric Inc.   108 Hillock Ct             Smithville  AK   99166-3208  130.00  224.00
+     10026Calla     Boshers   Saturn of Appleton             110 Fox River Dr           Smithville  AK   99166-3425  135.00  225.00
+     10027Carol     Brauer    Bemiss Corp.                   110 W North Water St       Jonestown   AK   99216-1144  140.00  226.00
+     10028Carol     Braun     AAL Member Credit Union        1115 E Glendale Ave        Smithville  AK   99311-5715  145.00  227.00
+     10029Cheri     Buksyk    Office Support                 1122 Milwaukee St          Jonestown   AK   99401-4175  150.00  228.00
+     10030Chuck     Buss      EAA                            1134 S Franklin St         Overton     AK   99401-9903  155.00  229.00
+     10031Chuck     Carpenter Kurz Electric                  115 S Drew St              Smithville  AK   99433-9418  160.00  230.00
+     10032Chuck     Carr      Alpha 1                        1151 Valley Fair Mall      Jonestown   AK   99451       165.00  231.00
+     10034Colleen   Casperson Valley Trust Corporation       120 N Morrison St          Smithville  AK   99501       175.00  233.00
+     10035Connie    Catterton Fox Community Credit Union     1200 N Perkins St          Smithville  AK   99901       180.00  234.00
+     10036Connie    Clay      Valley Lawn Care               121 N Douglas St # R       Smithville  AK   99901       185.00  235.00
+     10037Craig     Collar    Network Health Plan            1216 W Wisconsin Ave       Moretown    AK   99901       190.00  236.00
+     10038Dan       Coppenger Kolosso Toyota                 1221 N Lawe St             Smithville  AK   99901-2104  195.00  237.00
+     10039Dan       Dag       AAL                            1222 N Superior St         Smithville  AK   99901-299018200.2212238.99
+     10040Darlene   Dantzier  WDFF                           124 W Wisconsin Ave        Dime Box    AK   99901-4848  205.00  239.00
+     10041Darlene   DellenmannAAL                            130 E Franklin St          Smithville  AK   99901-7140  210.00  240.00
+     10042Darren    Dinkl     Novus Health Group             1300 E Calumet St          Smithville  AK   99903-2099  215.00  241.00
+     10043David     Dockry    AAL                            1302 S Ritger              Smithville  AK   99903-2692  220.00  242.00
+     10044Debra     Dorsey    AAL Capital Management         1320 S Lincoln St          Smithville  AK   99903-3065  225.00  243.00
+     10045Denise    RichardsonAAL Printing/Distribution      1396 Ridgeway Court        Smithville  AK   99911       230.00  244.00
+     10046Diane     Duginski  Lawrence University            144 N Mall Dr              Smithville  AK   99911         5.00 -245.00
+     10047Dick      Dunbar    Ken Gibson Assoc.              1461 Ashland Ave           Smithville  AK   99911       240.00  246.00
+     10048Dinah     Duxbury   Menasha Employees Credit Union 1486 Earl St               Dime Box    AK   99911       245.00  247.00
+     10049Dominic   Earl      UPIU                           150 W Green Bay Rd         Lonesome    AK   99911       250.00  248.00
+     10050Don       Ely       AAL                            1620 S Lawe St             Smithville  AK   99911       255.00  249.00
+     10052Donna     Erdmann   Fox Valley Technical College   1737 W Reid Dr             Smithville  AK   99911       265.00  251.00
+     10053Donna     Esser     Bergstrom Air Force Base       1801 N Richmond St # 12    Jonestown   AK   99911       270.00  252.00
+     10054Duane     Feavel    Bank One                       1818 N Meade St            Smithville  AK   99911-1995  275.00  253.00
+     10055Emmett    Forseth   Bergstrom Enterprises          1818 N Meade St            Smithville  AK   99911-2781  280.00  254.00
+     10056Erik      Francken  Fox Cities Bank                1825 N Bluemound Dr        Jonestown   AK   99911-3045  285.00  255.00
+     10057Father    Freitas   Town of Vandenbroek            1825 N Bluemound Dr        Smithville  AK   99911-3144   90.0012256.00
+     10058Gary      Garvey    Kitz Printing                  1909 W 2nd St              Overton     AK   99911-3499  295.00  257.00
+     10060George    Gibson    Prime Control Systems          1965 Oshkosh Ave           Smithville  AK   99911-4397  305.00  259.00
+     10061Glenn     Gorman    Van Vreede's                   1990 S Van Dyke Rd         Little GorgeAK   99911-4708  310.00  260.00
+     10062Howard    Grennon   Insurance Brokerage Services   200 W College Ave          Smithville  AK   99911-4721  315.00  261.00
+     10063Ingrid    Guyette   Fox Valley Travel              2074 American Dr           Overton     AK   99911-4828  320.00  262.00
+     10064Jacquie   Hagen     M & M Advertising              21 Waugoo Ave              Smithville  AK   99911-9972  325.00  263.00
+     10065James     Hammer    University of Women            212 E College Ave          Overton     AK   99911-9979  330.00  264.00
+     10066Jan       Hanks     YMCA                           213 Paul Dr                Jonestown   AK   99911-5712  335.00  265.00
+     10067Jane      Haugner   O'Donnell Publishing           217 Pacific St             Jonestown   AK   99911-5713  340.00  266.00
+     10068Jeff      Henneman  Western Ice                    218 E Lawrence St          Smithville  AK   99911-5713  345.00  267.00
+     10069Jeff      Holland   Four D Corporation             2181 W Wisconsin Ave       Appleton    TX   NULL          NULL    NULL
+     10070Jim       Hoppe     Andrews Mautner, Inc.          221 E Atlantic St          Moosetown   AK   99911-5735  355.00  269.00
+     10071Jim       Howard    Laser Typesetting              221 W College Ave          Smithville  AK   99911-5770  360.00  270.00
+     10072Jim       Ick       Wallach & Assoc.               222 E College Ave          Smithville  AK   99911-5798  365.00  271.00
+     10073Jim       Issacson  Town of Grand River            222 E College Ave          Smithville  AK   99911-5827  370.00  272.00
+     10074Jo Ann    Jahnke    Cabelvision                    225 Main St Box # 8003     Smithville  AK   99911-5862  375.00  273.00
+     10075Joanne    Jensen    Print & Mail, Inc.             2301 W Nordale Dr          Smithville  AK   99911-9106  380.00  274.00
+     10076Jodi      Jesse     Jewelers Mutual Insurance      231 E College Ave          Jonestown   AK   99912-0235  385.00  275.00
+     10077Joe       Jirtle    Burton Karstedt                2320 S Memorial Dr         Dime Box    AK   99912-0386  390.00  276.00
+     10079John      Johnson   Twin City Rod & Gun Club       250 Industrial Drive       Jonestown   AK   99912-1073  400.00  278.00
+     10080John      Kamp      American Legion                2600 Stewart Ave # 22      Smithville  AK   99913       405.00  279.00
+     10081John      Karstedt  TechLine                       2662 American Dr           Smithville  AK   99913-1697  410.00  280.00
+     10082John      Kitz      Data One Computer Service      2820 N Roemer Rd           Smithville  AK   99913-1936  415.00  281.00
+     10083John      Kolberg   Appleton Area School District  292 Ohio St                Smithville  AK   99913-2019  420.00  282.00
+     10084John      Korth     Banta Corporate                3000 W Wisconsin Ave       Dime Box    AK   99913-2798  425.00  283.00
+     10085John      Kotarek   HRC Inc.                       3012 Greenview Dr          Jonestown   AK   99914       430.00  284.00
+     10086Joyce     Kretsch   Phopar                         3036 W Wisconsin Ave       Smithville  AK   99914-1347  435.00  285.00
+     10087Judy      Kuehl     Sutherland Electric            3090 Oregon St             Smithville  AK   99914-1426  440.00  286.00
+     10088Katie     Kusserow  Banta Credit Union             310 Appleton St            Dime Box    AK   99914-1483  445.00  288.00
+     10089Kay       Lambert   Uffenbeck Diamonds             319 Main St                Smithville  AK   99914-1698  450.00  289.00
+     10090Ken       Lamb      Equitable Reserve Association  32122 Paseo Adelanto Ste 2BJonestown   AK   99914-1698  455.00  290.00
+     10091Kevin     Lensby    Derksen Printing               3218 Timothy Ln #6         Overton     AK   99914-1737  460.00  291.00
+     10092Larry     LesperanceCustom Printing                322 N Commercial St        Smithville  AK   99914-1888  465.00  292.00
+     10093Larry     Lindberg  Faye's Fine Jewelry            3232 N Ballard Rd          Jonestown   AK   99914-3121  470.00  293.00
+     10094Linda     LinonofskiHaugners Inc.                  33 Park Pl                 Smithville  AK   99914-3136  475.00  294.00
+     10095Linda     Long      Pyramid Marketing & Advertising3301 W Prospect Ave        Smithville  AK   99914-3169  480.00  295.00
+     10097Liz       Lonsway   Wisconsin Tissue Credit Union  333 W College Ave          Jonestown   AK   99914-3599  490.00  297.00
+     10098Lon       Lowe      AAL                            342 W Wisconsin Ave        Smithville  AK   99914-3566  495.00  298.00
+     10099Lori      Ludwig    Pat Woods Inc                  3730 W College Ave         Kimbro      AK   99914-3920  500.00  299.00
+     10100Luke      Madison   Creative Learning International375 Byrd Ave               Jonestown   AK   99914-3975  505.00  301.00
+     10101Mark      Mancl     United Health                  3992 N Richmond St         Smithville  AK   99914-3989  510.00  302.00
+     10102Mark      Melissa   Memorial Florists              408 W Wisconsin Ave        Smithville  AK   99914-4698  515.00  303.00
+     10103Marlene   Mentink   Fay Hawkinson & Kruse Inc      411 Lincoln St             Overton     AK   99914-5175  520.00  304.00
+     10104Marti     MerryfieldEnterprise Motors              419 N Oneida St            Smithville  AK   99914-5230  525.00  305.00
+     10105Marty     Meyere    Weidert Group Inc              420 E Longville Dr         Smithville  AK   99915       530.00  306.00
+     10106Mary      Micke     Principal Financial            4301 W Wisconsin Ave       Smithville  AK   99915       535.00  307.00
+     10107Mary      Mohr      Woodfield Suites               4321 N Ballard Rd          Smithville  AK   99915       540.00  308.00
+     10108Mary      Mortensen Master Litho                   4321 N Ballard Rd          Jonestown   AK   99915-1429  545.00  309.00
+     10109Mary      Mueller   Rawhide Boys Ranch             4321 N Ballard Rd          New Hope    AK   99915-1488  550.00    0.00
+     10110Mary      Mugerauer Ad Works                       4321 N Ballard Rd          Smithville  AK   99915-2241  555.00  311.00
+     10111Mary      Novak     Directions Inc                 4321 N Ballard Rd          Jonestown   AK   99915-2401  560.00  312.00
+     10112Mary Beth O'Donnell Counseling Resource Center     4321 N Ballard Rd          Smithville  AK   99915-2421  565.00  313.00
+     10113Mary      PannabakerWorld Wide Auto Parts          4321 W College Ave         Smithville  AK   99915-9951  570.00  314.00
+     10114Michelle  Pawlowski Secura Insurance               4406 W Spencer St          Smithville  AK   99915-9986  575.00  315.00
+     10115Mike      Peter     Witthuhn Printing              4895 Integrity Way         Smithville  AK   99915-7802  580.00  316.00
+     10116Mike      Peters    St Mary's Central High School  502 W Northland Ave        Dime Box    AK   99915-8299  585.00  317.00
+     10117Mike      Phillips  Valley Periodontics            517 N Appleton St          Smithville  AK   99915-8288  590.00  319.00
+     10118Nancy     Rapp      Neenah Printing                520 E Wisconsin Ave        Jonestown   AK   99915-8410  595.00  320.00
+     10119Nancy     Rasmussen YMCA of Appleton               520 E Wisconsin Ave        Smithville  AK   99915-8734  600.00  321.00
+     10120Nancy     Rathman   Appleton Medical Center        525 Enterprise Dr          Smithville  AK   99915-8897  605.00  322.00
+     10121Nancy     Reinl     Quinlan Dentistry              525 N Perkins St           Smithville  AK   99915-9010  610.00  323.00
+     10122Natalie   Reynolds  Klusendorf Chiropractic        528 2nd St                 Smithville  AK   99915-9106  615.00  324.00
+     10123Pam       Richeson  Drucks Plumbing                531 N Main St              Dime Box    AK   99915-9108  620.00  325.00
+     10124Pat       Robbins   Market Link                    557 S Marcella St          Smithville  AK   99915-9210  625.00  326.00
+     10125Pat       Roberts   Norandex                       610 E Wisconsin Ave        Smithville  AK   99915-9295  630.00  327.00
+     10129Mickey    Mouse     Disneyland                     NULL                       NULL        NULL    NULL       NULL    NULL

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt3.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt3.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt3.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+(10000)	(Bugs)	(Bunny)	 (Warner Brothers)			(CA)		(0.0)	(100.00),(10019)	(Bobbi)	(Arndt)	(Market Place)	(1000 S Nicolet Rd)	(Sametown)	(TX)	(99136-1221)	(100.00)	(218.00),(10023)	(Bruce)	(Beecher)	(Madson & Huth Communication Co)	(1037 W Wisconsin Ave)	(Smithville)	(AK)	(99140-1599)	(120.00)	(222.00),(10024)	(Bruce)	(Beyer)	(La Salle Clinic)	(108 E Wisconsin Ave)	(Jonestown)	(AK)	(99143-1803)	(125.00)	(223.00),(10025)	(Butch)	(Bobbi)	(Town & Country Electric Inc.)	(108 Hillock Ct)	(Smithville)	(AK)	(99166-3208)	(130.00)	(224.00),(10026)	(Calla)	(Boshers)	(Saturn of Appleton)	(110 Fox River Dr)	(Smithville)	(AK)	(99166-3425)	(135.00)	(225.00),(10027)	(Carol)	(Brauer)	(Bemiss Corp.)	(110 W North Water St)	(Jonestown)	(AK)	(99216-1144)	(140.00)	(226.00),(10028)	(Carol)	(Braun)	(AAL Member Credit Union)	(1115 E Glendale Ave)	(Smithville)	(AK)	(99311-5715)	(145.00)	(227.00),(10029)	(Cheri)	(Buksyk)	(Office Support)	(1122 Milwaukee St)	(Jonestown)	(AK)	(99401-4175)	(150.00)	(228.00),(10030)	(Chuck)	(Buss)	(EAA)	(1134 S Franklin St)	(Overton)	(AK)	(99401-9903)	(155.00)	(229.00),(10031)	(Chuck)	(Carpenter)	(Kurz Electric)	(115 S Drew St)	(Smithville)	(AK)	(99433-9418)	(160.00)	(230.00),(10032)	(Chuck)	(Carr)	(Alpha 1)	(1151 Valley Fair Mall)	(Jonestown)	(AK)	(99451)	(165.00)	(231.00),(10034)	(Colleen)	(Casperson)	(Valley Trust Corporation)	(120 N Morrison St)	(Smithville)	(AK)	(99501)	(175.00)	(233.00),(10035)	(Connie)	(Catterton)	(Fox Community Credit Union)	(1200 N Perkins St)	(Smithville)	(AK)	(99901)	(180.00)	(234.00),(10036)	(Connie)	(Clay)	(Valley Lawn Care)	(121 N Douglas St # R)	(Smithville)	(AK)	(99901)	(185.00)	(235.00),(10037)	(Craig)	(Collar)	(Network Health Plan)	(1216 W Wisconsin Ave)	(Moretown)	(AK)	(99901)	(190.00)	(236.00),(10038)	(Dan)	(Coppenger)	(Kolosso Toyota)	(1221 N Lawe St)	(Smithville)	(AK)	(99901-2104)	(195.00)	(237.00),(10039)	(Dan)	(Dag)	(AAL)	(1222 N Superior St)	(Smithville)	(AK)	(99901-2990)	(200.00)	(238.00),(10040)	(Darlene)	(Dantzier)	(WDFF)	(124 W Wisconsin Ave)	(Dime Box)	(AK)	(99901-4848)	(205.00)	(239.00),(10041)	(Darlene)	(Dellenmann)	(AAL)	(130 E Franklin St)	(Smithville)	(AK)	(99901-7140)	(210.00)	(240.00),(10042)	(Darren)	(Dinkl)	(Novus Health Group)	(1300 E Calumet St)	(Smithville)	(AK)	(99903-2099)	(215.00)	(241.00),(10043)	(David)	(Dockry)	(AAL)	(1302 S Ritger)	(Smithville)	(AK)	(99903-2692)	(220.00)	(242.00),(10044)	(Debra)	(Dorsey)	(AAL Capital Management)	(1320 S Lincoln St)	(Smithville)	(AK)	(99903-3065)	(225.00)	(243.00),(10045)	(Denise)	(Richardson)	(AAL Printing/Distribution)	(1396 Ridgeway Court)	(Smithville)	(AK)	(99911)	(230.00)	(244.00),(10046)	(Diane)	(Duginski)	(Lawrence University)	(144 N Mall Dr)	(Smithville)	(AK)	(99911)	(235.00)	(245.00),(10047)	(Dick)	(Dunbar)	(Ken Gibson Assoc.)	(1461 Ashland Ave)	(Smithville)	(AK)	(99911)	(240.00)	(246.00),(10048)	(Dinah)	(Duxbury)	(Menasha Employees Credit Union)	(1486 Earl St)	(Dime Box)	(AK)	(99911)	(245.00)	(247.00),(10049)	(Dominic)	(Earl)	(UPIU)	(150 W Green Bay Rd)	(Lonesome)	(AK)	(99911)	(250.00)	(248.00),(10050)	(Don)	(Ely)	(AAL)	(1620 S Lawe St)	(Smithville)	(AK)	(99911)	(255.00)	(249.00),(10052)	(Donna)	(Erdmann)	(Fox Valley Technical College)	(1737 W Reid Dr)	(Smithville)	(AK)	(99911)	(265.00)	(251.00),(10053)	(Donna)	(Esser)	(Bergstrom Air Force Base)	(1801 N Richmond St # 12)	(Jonestown)	(AK)	(99911)	(270.00)	(252.00),(10054)	(Duane)	(Feavel)	(Bank One)	(1818 N Meade St)	(Smithville)	(AK)	(99911-1995)	(275.00)	(253.00),(10055)	(Emmett)	(Forseth)	(Bergstrom Enterprises)	(1818 N Meade St)	(Smithville)	(AK)	(99911-2781)	(280.00)	(254.00),(10056)	(Erik)	(Francken)	(Fox Cities Bank)	(1825 N Bluemound Dr)	(Jonestown)	(AK)	(99911-3045)	(285.00)	(255.00),(10057)	(Father)	(Freitas)	(Town of Vandenbroek)	(1825 N Bluemound Dr)	(Smithville)	(AK)	(99911-3144)	(290.00)	(256.00),(10058)	(Gary)	(Garvey)	(Kitz Printing)	(1909 W 2nd St)	(Overton)	(AK)	(99911-3499)	(295.00)	(257.00),(10060)	(George)	(Gibson)	(Prime Control Systems)	(1965 Oshkosh Ave)	(Smithville)	(AK)	(99911-4397)	(305.00)	(259.00),(10061)	(Glenn)	(Gorman)	(Van Vreede's)	(1990 S Van Dyke Rd)	(Little Gorge)	(AK)	(99911-4708)	(310.00)	(260.00),(10062)	(Howard)	(Grennon)	(Insurance Brokerage Services)	(200 W College Ave)	(Smithville)	(AK)	(99911-4721)	(315.00)	(261.00),(10063)	(Ingrid)	(Guyette)	(Fox Valley Travel)	(2074 American Dr)	(Overton)	(AK)	(99911-4828)	(320.00)	(262.00),(10064)	(Jacquie)	(Hagen)	(M & M Advertising)	(21 Waugoo Ave)	(Smithville)	(AK)	(99911-9972)	(325.00)	(263.00),(10065)	(James)	(Hammer)	(University of Women)	(212 E College Ave)	(Overton)	(AK)	(99911-9979)	(330.00)	(264.00),(10066)	(Jan)	(Hanks)	(YMCA)	(213 Paul Dr)	(Jonestown)	(AK)	(99911-5712)	(335.00)	(265.00),(10067)	(Jane)	(Haugner)	(O'Donnell Publishing)	(217 Pacific St)	(Jonestown)	(AK)	(99911-5713)	(340.00)	(266.00),(10068)	(Jeff)	(Henneman)	(Western Ice)	(218 E Lawrence St)	(Smithville)	(AK)	(99911-5713)	(345.00)	(267.00),(10069)	(Jeff)	(Holland)	(Four D Corporation)	(2181 W Wisconsin Ave)		(TX)	(99911-5724)	(350.00)	(268.00),(10070)	(Jim)	(Hoppe)	(Andrews Mautner	 Inc.)	(221 E Atlantic St)	(Moosetown)	(AK)	(99911-5735)	(355.00)	(269.00),(10071)	(Jim)	(Howard)	(Laser Typesetting)	(221 W College Ave)	(Smithville)	(AK)	(99911-5770)	(360.00)	(270.00),(10072)	(Jim)	(Ick)	(Wallach & Assoc.)	(222 E College Ave)	(Smithville)	(AK)	(99911-5798)	(365.00)	(271.00),(10073)	(Jim)	(Issacson)	(Town of Grand River)	(222 E College Ave)	(Smithville)	(AK)	(99911-5827)	(370.00)	(272.00),(10074)	(Jo Ann)	(Jahnke)	(Cabelvision)	(225 Main St Box # 8003)	(Smithville)	(AK)	(99911-5862)	(375.00)	(273.00),(10075)	(Joanne)	(Jensen)	(Print & Mail	 Inc.)	(2301 W Nordale Dr)	(Smithville)	(AK)	(99911-9106)	(380.00)	(274.00),(10076)	(Jodi)	(Jesse)	(Jewelers Mutual Insurance)	(231 E College Ave)	(Jonestown)	(AK)	(99912-0235)	(385.00)	(275.00),(10077)	(Joe)	(Jirtle)	(Burton Karstedt)	(2320 S Memorial Dr)	(Dime Box)	(AK)	(99912-0386)	(390.00)	(276.00),(10079)	(John)	(Johnson)	(Twin City Rod & Gun Club)	(250 Industrial Drive)	(Jonestown)	(AK)	(99912-1073)	(400.00)	(278.00),(10080)	(John)	(Kamp)	(American Legion)	(2600 Stewart Ave # 22)	(Smithville)	(AK)	(99913)	(405.00)	(279.00),(10081)	(John)	(Karstedt)	(TechLine)	(2662 American Dr)	(Smithville)	(AK)	(99913-1697)	(410.00)	(280.00),(10082)	(John)	(Kitz)	(Data One Computer Service)	(2820 N Roemer Rd)	(Smithville)	(AK)	(99913-1936)	(415.00)	(281.00),(10083)	(John)	(Kolberg)	(Appleton Area School District)	(292 Ohio St)	(Smithville)	(AK)	(99913-2019)	(420.00)	(282.00),(10084)	(John)	(Korth)	(Banta Corporate)	(3000 W Wisconsin Ave)	(Dime Box)	(AK)	(99913-2798)	(425.00)	(283.00),(10085)	(John)	(Kotarek)	(HRC Inc.)	(3012 Greenview Dr)	(Jonestown)	(AK)	(99914)	(430.00)	(284.00),(10086)	(Joyce)	(Kretsch)	(Phopar)	(3036 W Wisconsin Ave)	(Smithville)	(AK)	(99914-1347)	(435.00)	(285.00),(10087)	(Judy)	(Kuehl)	(Sutherland Electric)	(3090 Oregon St)	(Smithville)	(AK)	(99914-1426)	(440.00)	(286.00),(10088)	(Katie)	(Kusserow)	(Banta Credit Union)	(310 Appleton St)	(Dime Box)	(AK)	(99914-1483)	(445.00)	(288.00),(10089)	(Kay)	(Lambert)	(Uffenbeck Diamonds)	(319 Main St)	(Smithville)	(AK)	(99914-1698)	(450.00)	(289.00),(10090)	(Ken)	(Lamb)	(Equitable Reserve Association)	(32122 Paseo Adelanto Ste 2B)	(Jonestown)	(AK)	(99914-1698)	(455.00)	(290.00),(10091)	(Kevin)	(Lensby)	(Derksen Printing)	(3218 Timothy Ln #6)	(Overton)	(AK)	(99914-1737)	(460.00)	(291.00),(10092)	(Larry)	(Lesperance)	(Custom Printing)	(322 N Commercial St)	(Smithville)	(AK)	(99914-1888)	(465.00)	(292.00),(10093)	(Larry)	(Lindberg)	(Faye's Fine Jewelry)	(3232 N Ballard Rd)	(Jonestown)	(AK)	(99914-3121)	(470.00)	(293.00),(10094)	(Linda)	(Linonofski)	(Haugners Inc.)	(33 Park Pl)	(Smithville)	(AK)	(99914-3136)	(475.00)	(294.00),(10095)	(Linda)	(Long)	(Pyramid Marketing & Advertising)	(3301 W Prospect Ave)	(Smithville)	(AK)	(99914-3169)	(480.00)	(295.00),(10097)	(Liz)	(Lonsway)	(Wisconsin Tissue Credit Union)	(333 W College Ave)	(Jonestown)	(AK)	(99914-3599)	(490.00)	(297.00),(10098)	(Lon)	(Lowe)	(AAL)	(342 W Wisconsin Ave)	(Smithville)	(AK)	(99914-3566)	(495.00)	(298.00),(10099)	(Lori)	(Ludwig)	(Pat Woods Inc)	(3730 W College Ave)	(Kimbro)	(AK)	(99914-3920)	(500.00)	(299.00),(10100)	(Luke)	(Madison)	(Creative Learning International)	(375 Byrd Ave)	(Jonestown)	(AK)	(99914-3975)	(505.00)	(301.00),(10101)	(Mark)	(Mancl)	(United Health)	(3992 N Richmond St)	(Smithville)	(AK)	(99914-3989)	(510.00)	(302.00),(10102)	(Mark)	(Melissa)	(Memorial Florists)	(408 W Wisconsin Ave)	(Smithville)	(AK)	(99914-4698)	(515.00)	(303.00),(10103)	(Marlene)	(Mentink)	(Fay Hawkinson & Kruse Inc)	(411 Lincoln St)	(Overton)	(AK)	(99914-5175)	(520.00)	(304.00),(10104)	(Marti)	(Merryfield)	(Enterprise Motors)	(419 N Oneida St)	(Smithville)	(AK)	(99914-5230)	(525.00)	(305.00),(10105)	(Marty)	(Meyere)	(Weidert Group Inc)	(420 E Longville Dr)	(Smithville)	(AK)	(99915)	(530.00)	(306.00),(10106)	(Mary)	(Micke)	(Principal Financial)	(4301 W Wisconsin Ave)	(Smithville)	(AK)	(99915)	(535.00)	(307.00),(10107)	(Mary)	(Mohr)	(Woodfield Suites)	(4321 N Ballard Rd)	(Smithville)	(AK)	(99915)	(540.00)	(308.00),(10108)	(Mary)	(Mortensen)	(Master Litho)	(4321 N Ballard Rd)	(Jonestown)	(AK)	(99915-1429)	(545.00)	(309.00),(10109)	(Mary)	(Mueller)	(Rawhide Boys Ranch)	(4321 N Ballard Rd)	(New Hope)	(AK)	(99915-1488)	(550.00)	(310.00),(10110)	(Mary)	(Mugerauer)	(Ad Works)	(4321 N Ballard Rd)	(Smithville)	(AK)	(99915-2241)	(555.00)	(311.00),(10111)	(Mary)	(Novak)	(Directions Inc)	(4321 N Ballard Rd)	(Jonestown)	(AK)	(99915-2401)	(560.00)	(312.00),(10112)	(Mary Beth)	(O'Donnell)	(Counseling Resource Center)	(4321 N Ballard Rd)	(Smithville)	(AK)	(99915-2421)	(565.00)	(313.00),(10113)	(Mary)	(Pannabaker)	(World Wide Auto Parts)	(4321 W College Ave)	(Smithville)	(AK)	(99915-9951)	(570.00)	(314.00),(10114)	(Michelle)	(Pawlowski)	(Secura Insurance)	(4406 W Spencer St)	(Smithville)	(AK)	(99915-9986)	(575.00)	(315.00),(10115)	(Mike)	(Peter)	(Witthuhn Printing)	(4895 Integrity Way)	(Smithville)	(AK)	(99915-7802)	(580.00)	(316.00),(10116)	(Mike)	(Peters)	(St Mary's Central High School)	(502 W Northland Ave)	(Dime Box)	(AK)	(99915-8299)	(585.00)	(317.00),(10117)	(Mike)	(Phillips)	(Valley Periodontics)	(517 N Appleton St)	(Smithville)	(AK)	(99915-8288)	(590.00)	(319.00),(10118)	(Nancy)	(Rapp)	(Neenah Printing)	(520 E Wisconsin Ave)	(Jonestown)	(AK)	(99915-8410)	(595.00)	(320.00),(10119)	(Nancy)	(Rasmussen)	(YMCA of Appleton)	(520 E Wisconsin Ave)	(Smithville)	(AK)	(99915-8734)	(600.00)	(321.00),(10120)	(Nancy)	(Rathman)	(Appleton Medical Center)	(525 Enterprise Dr)	(Smithville)	(AK)	(99915-8897)	(605.00)	(322.00),(10121)	(Nancy)	(Reinl)	(Quinlan Dentistry)	(525 N Perkins St)	(Smithville)	(AK)	(99915-9010)	(610.00)	(323.00),(10122)	(Natalie)	(Reynolds)	(Klusendorf Chiropractic)	(528 2nd St)	(Smithville)	(AK)	(99915-9106)	(615.00)	(324.00),(10123)	(Pam)	(Richeson)	(Drucks Plumbing)	(531 N Main St)	(Dime Box)	(AK)	(99915-9108)	(620.00)	(325.00),(10124)	(Pat)	(Robbins)	(Market Link)	(557 S Marcella St)	(Smithville)	(AK)	(99915-9210)	(625.00)	(326.00),(10125)	(Pat)	(Roberts)	(Norandex)	(610 E Wisconsin Ave)	(Smithville)	(AK)	(99915-9295)	(630.00)	(327.00),(10126)	(Peg)	(Russel)	(Appleton Camping)	(675 Brighton Beach Rd)	(Smithville)	(AK)	(99915-9701)	(635.00)	(328.00),(10129)	(Mickey)	(Mouse)	(Disneyland)	(Magic Kingdom)	(Los Angeles)	(CA)	(94000)		,

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt4.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt4.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt4.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,103 @@
+"Account No"FieldSep	"First Name"FieldSep	"Last Name"FieldSep	"Company"FieldSep	"Address"FieldSep	"City"FieldSep	"State"FieldSep	"Zip"FieldSep	"Last Pymt"FieldSep	"Balance";
+FS10000FEFXFSBugsFEFXFSBunnyFEFXFSWarner BrothersFEFXFSRabbit HoleFEFXFS Los AngelesFEFXFSCAFEFXFS94001FEFXFS0.00FEFXFS10000.00FE;
+FS10039FEFXFSDanFEFXFSDagFEFXFSAALFEFXFS1222 N Superior StFEFXFSSmithvilleFEFXFSAKFEFXFS99901-2990FEFXFS200.00FEFXFS238.00FE;
+FS10041FEFXFSDarleneFEFXFSDellenmannFEFXFSAALFEFXFS130 E Franklin StFEFXFSSmithvilleFEFXFSAKFEFXFS99901-7140FEFXFS210.00FEFXFS240.00FE;
+FS10043FEFXFSDavidFEFXFSDockryFEFXFSAALFEFXFS1302 S RitgerFEFXFSSmithvilleFEFXFSAKFEFXFS99903-2692FEFXFS220.00FEFXFS242.00FE;
+FS10050FEFXFSDonFEFXFSElyFEFXFSAALFEFXFS1620 S Lawe StFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS255.00FEFXFS249.00FE;
+FS10098FEFXFSLonFEFXFSLoweFEFXFSAALFEFXFS342 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3566FEFXFS495.00FEFXFS298.00FE;
+FS10044FEFXFSDebraFEFXFSDorseyFEFXFSAAL Capital ManagementFEFXFS1320 S Lincoln StFEFXFSSmithvilleFEFXFSAKFEFXFS99903-3065FEFXFS225.00FEFXFS243.00FE;
+FS10028FEFXFSCarolFEFXFSBraunFEFXFSAAL Member Credit UnionFEFXFS1115 E Glendale AveFEFXFSSmithvilleFEFXFSAKFEFXFS99311-5715FEFXFS145.00FEFXFS227.00FE;
+FS10045FEFXFSDeniseFEFXFSRichardsonFEFXFSAAL Printing/DistributionFEFXFS1396 Ridgeway CourtFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS230.00FEFXFS244.00FE;
+FS10110FEFXFSMaryFEFXFSMugerauerFEFXFSAd WorksFEFXFS4321 N Ballard RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915-2241FEFXFS555.00FEFXFS311.00FE;
+FS10032FEFXFSChuckFEFXFSCarrFEFXFSAlpha 1FEFXFS1151 Valley Fair MallFEFXFSJonestownFEFXFSAKFEFXFS99451FEFXFS165.00FEFXFS231.00FE;
+FS10080FEFXFSJohnFEFXFSKampFEFXFSAmerican LegionFEFXFS2600 Stewart Ave # 22FEFXFSSmithvilleFEFXFSAKFEFXFS99913FEFXFS405.00FEFXFS279.00FE;
+FS10070FEFXFSJimFEFXFSHoppeFEFXFSAndrews MautnerFX Inc.FEFXFS221 E Atlantic StFEFXFSMoosetownFEFXFSAKFEFXFS99911-5735FEFXFS355.00FEFXFS269.00FE;
+FS10083FEFXFSJohnFEFXFSKolbergFEFXFSAppleton Area School DistrictFEFXFS292 Ohio StFEFXFSSmithvilleFEFXFSAKFEFXFS99913-2019FEFXFS420.00FEFXFS282.00FE;
+FS10126FEFXFSPegFEFXFSRusselFEFXFSAppleton CampingFEFXFS675 Brighton Beach RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9701FEFXFS635.00FEFXFS328.00FE;
+FS10120FEFXFSNancyFEFXFSRathmanFEFXFSAppleton Medical CenterFEFXFS525 Enterprise DrFEFXFSSmithvilleFEFXFSAKFEFXFS99915-8897FEFXFS605.00FEFXFS322.00FE;
+FS10054FEFXFSDuaneFEFXFSFeavelFEFXFSBank OneFEFXFS1818 N Meade StFEFXFSSmithvilleFEFXFSAKFEFXFS99911-1995FEFXFS275.00FEFXFS253.00FE;
+FS10084FEFXFSJohnFEFXFSKorthFEFXFSBanta CorporateFEFXFS3000 W Wisconsin AveFEFXFSDime BoxFEFXFSAKFEFXFS99913-2798FEFXFS425.00FEFXFS283.00FE;
+FS10088FEFXFSKatieFEFXFSKusserowFEFXFSBanta Credit UnionFEFXFS310 Appleton StFEFXFSDime BoxFEFXFSAKFEFXFS99914-1483FEFXFS445.00FEFXFS288.00FE;
+FS10027FEFXFSCarolFEFXFSBrauerFEFXFSBemiss Corp.FEFXFS110 W North Water StFEFXFSJonestownFEFXFSAKFEFXFS99216-1144FEFXFS140.00FEFXFS226.00FE;
+FS10053FEFXFSDonnaFEFXFSEsserFEFXFSBergstrom Air Force BaseFEFXFS1801 N Richmond St # 12FEFXFSJonestownFEFXFSAKFEFXFS99911FEFXFS270.00FEFXFS252.00FE;
+FS10055FEFXFSEmmettFEFXFSForsethFEFXFSBergstrom EnterprisesFEFXFS1818 N Meade StFEFXFSSmithvilleFEFXFSAKFEFXFS99911-2781FEFXFS280.00FEFXFS254.00FE;
+FS10077FEFXFSJoeFEFXFSJirtleFEFXFSBurton KarstedtFEFXFS2320 S Memorial DrFEFXFSDime BoxFEFXFSAKFEFXFS99912-0386FEFXFS390.00FEFXFS276.00FE;
+FS10074FEFXFSJo AnnFEFXFSJahnkeFEFXFSCabelvisionFEFXFS225 Main St Box # 8003FEFXFSSmithvilleFEFXFSAKFEFXFS99911-5862FEFXFS375.00FEFXFS273.00FE;
+FS10112FEFXFSMary BethFEFXFSO'DonnellFEFXFSCounseling Resource CenterFEFXFS4321 N Ballard RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915-2421FEFXFS565.00FEFXFS313.00FE;
+FS10100FEFXFSLukeFEFXFSMadisonFEFXFSCreative Learning InternationalFEFXFS375 Byrd AveFEFXFSJonestownFEFXFSAKFEFXFS99914-3975FEFXFS505.00FEFXFS301.00FE;
+FS10092FEFXFSLarryFEFXFSLesperanceFEFXFSCustom PrintingFEFXFS322 N Commercial StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1888FEFXFS465.00FEFXFS292.00FE;
+FS10082FEFXFSJohnFEFXFSKitzFEFXFSData One Computer ServiceFEFXFS2820 N Roemer RdFEFXFSSmithvilleFEFXFSAKFEFXFS99913-1936FEFXFS415.00FEFXFS281.00FE;
+FS10091FEFXFSKevinFEFXFSLensbyFEFXFSDerksen PrintingFEFXFS3218 Timothy Ln #6FEFXFSOvertonFEFXFSAKFEFXFS99914-1737FEFXFS460.00FEFXFS291.00FE;
+FS10111FEFXFSMaryFEFXFSNovakFEFXFSDirections IncFEFXFS4321 N Ballard RdFEFXFSJonestownFEFXFSAKFEFXFS99915-2401FEFXFS560.00FEFXFS312.00FE;
+FS10123FEFXFSPamFEFXFSRichesonFEFXFSDrucks PlumbingFEFXFS531 N Main StFEFXFSDime BoxFEFXFSAKFEFXFS99915-9108FEFXFS620.00FEFXFS325.00FE;
+FS10030FEFXFSChuckFEFXFSBussFEFXFSEAAFEFXFS1134 S Franklin StFEFXFSOvertonFEFXFSAKFEFXFS99401-9903FEFXFS155.00FEFXFS229.00FE;
+FS10104FEFXFSMartiFEFXFSMerryfieldFEFXFSEnterprise MotorsFEFXFS419 N Oneida StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-5230FEFXFS525.00FEFXFS305.00FE;
+FS10090FEFXFSKenFEFXFSLambFEFXFSEquitable Reserve AssociationFEFXFS32122 Paseo Adelanto Ste 2BFEFXFSJonestownFEFXFSAKFEFXFS99914-1698FEFXFS455.00FEFXFS290.00FE;
+FS10103FEFXFSMarleneFEFXFSMentinkFEFXFSFay Hawkinson & Kruse IncFEFXFS411 Lincoln StFEFXFSOvertonFEFXFSAKFEFXFS99914-5175FEFXFS520.00FEFXFS304.00FE;
+FS10093FEFXFSLarryFEFXFSLindbergFEFXFSFaye's Fine JewelryFEFXFS3232 N Ballard RdFEFXFSJonestownFEFXFSAKFEFXFS99914-3121FEFXFS470.00FEFXFS293.00FE;
+FS10069FEFXFSJeffFEFXFSHollandFEFXFSFour D CorporationFEFXFS2181 W Wisconsin AveFEFXFSAppletonFEFXFSTXFEFXFS99911-5724FEFXFS350.00FEFXFS268.00FE;
+FS10056FEFXFSErikFEFXFSFranckenFEFXFSFox Cities BankFEFXFS1825 N Bluemound DrFEFXFSJonestownFEFXFSAKFEFXFS99911-3045FEFXFS285.00FEFXFS255.00FE;
+FS10035FEFXFSConnieFEFXFSCattertonFEFXFSFox Community Credit UnionFEFXFS1200 N Perkins StFEFXFSSmithvilleFEFXFSAKFEFXFS99901FEFXFS180.00FEFXFS234.00FE;
+FS10052FEFXFSDonnaFEFXFSErdmannFEFXFSFox Valley Technical CollegeFEFXFS1737 W Reid DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS265.00FEFXFS251.00FE;
+FS10063FEFXFSIngridFEFXFSGuyetteFEFXFSFox Valley TravelFEFXFS2074 American DrFEFXFSOvertonFEFXFSAKFEFXFS99911-4828FEFXFS320.00FEFXFS262.00FE;
+FS10085FEFXFSJohnFEFXFSKotarekFEFXFSHRC Inc.FEFXFS3012 Greenview DrFEFXFSJonestownFEFXFSAKFEFXFS99914FEFXFS430.00FEFXFS284.00FE;
+FS10094FEFXFSLindaFEFXFSLinonofskiFEFXFSHaugners Inc.FEFXFS33 Park PlFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3136FEFXFS475.00FEFXFS294.00FE;
+FS10062FEFXFSHowardFEFXFSGrennonFEFXFSInsurance Brokerage ServicesFEFXFS200 W College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-4721FEFXFS315.00FEFXFS261.00FE;
+FS10076FEFXFSJodiFEFXFSJesseFEFXFSJewelers Mutual InsuranceFEFXFS231 E College AveFEFXFSJonestownFEFXFSAKFEFXFS99912-0235FEFXFS385.00FEFXFS275.00FE;
+FS10047FEFXFSDickFEFXFSDunbarFEFXFSKen Gibson Assoc.FEFXFS1461 Ashland AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS240.00FEFXFS246.00FE;
+FS10058FEFXFSGaryFEFXFSGarveyFEFXFSKitz PrintingFEFXFS1909 W 2nd StFEFXFSOvertonFEFXFSAKFEFXFS99911-3499FEFXFS295.00FEFXFS257.00FE;
+FS10122FEFXFSNatalieFEFXFSReynoldsFEFXFSKlusendorf ChiropracticFEFXFS528 2nd StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9106FEFXFS615.00FEFXFS324.00FE;
+FS10038FEFXFSDanFEFXFSCoppengerFEFXFSKolosso ToyotaFEFXFS1221 N Lawe StFEFXFSSmithvilleFEFXFSAKFEFXFS99901-2104FEFXFS195.00FEFXFS237.00FE;
+FS10031FEFXFSChuckFEFXFSCarpenterFEFXFSKurz ElectricFEFXFS115 S Drew StFEFXFSSmithvilleFEFXFSAKFEFXFS99433-9418FEFXFS160.00FEFXFS230.00FE;
+FS10024FEFXFSBruceFEFXFSBeyerFEFXFSLa Salle ClinicFEFXFS108 E Wisconsin AveFEFXFSJonestownFEFXFSAKFEFXFS99143-1803FEFXFS125.00FEFXFS223.00FE;
+FS10071FEFXFSJimFEFXFSHowardFEFXFSLaser TypesettingFEFXFS221 W College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5770FEFXFS360.00FEFXFS270.00FE;
+FS10046FEFXFSDianeFEFXFSDuginskiFEFXFSLawrence UniversityFEFXFS144 N Mall DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS235.00FEFXFS245.00FE;
+FS10064FEFXFSJacquieFEFXFSHagenFEFXFSM & M AdvertisingFEFXFS21 Waugoo AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-9972FEFXFS325.00FEFXFS263.00FE;
+FS10023FEFXFSBruceFEFXFSBeecherFEFXFSMadson & Huth Communication CoFEFXFS1037 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99140-1599FEFXFS120.00FEFXFS222.00FE;
+FS10124FEFXFSPatFEFXFSRobbinsFEFXFSMarket LinkFEFXFS557 S Marcella StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9210FEFXFS625.00FEFXFS326.00FE;
+FS10019FEFXFSBobbiFEFXFSArndtFEFXFSMarket PlaceFEFXFS1000 S Nicolet RdFEFXFSSametownFEFXFSTXFEFXFS99136-1221FEFXFS100.00FEFXFS218.00FE;
+FS10108FEFXFSMaryFEFXFSMortensenFEFXFSMaster LithoFEFXFS4321 N Ballard RdFEFXFSJonestownFEFXFSAKFEFXFS99915-1429FEFXFS545.00FEFXFS309.00FE;
+FS10102FEFXFSMarkFEFXFSMelissaFEFXFSMemorial FloristsFEFXFS408 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-4698FEFXFS515.00FEFXFS303.00FE;
+FS10048FEFXFSDinahFEFXFSDuxburyFEFXFSMenasha Employees Credit UnionFEFXFS1486 Earl StFEFXFSDime BoxFEFXFSAKFEFXFS99911FEFXFS245.00FEFXFS247.00FE;
+FS10118FEFXFSNancyFEFXFSRappFEFXFSNeenah PrintingFEFXFS520 E Wisconsin AveFEFXFSJonestownFEFXFSAKFEFXFS99915-8410FEFXFS595.00FEFXFS320.00FE;
+FS10037FEFXFSCraigFEFXFSCollarFEFXFSNetwork Health PlanFEFXFS1216 W Wisconsin AveFEFXFSMoretownFEFXFSAKFEFXFS99901FEFXFS190.00FEFXFS236.00FE;
+FS10125FEFXFSPatFEFXFSRobertsFEFXFSNorandexFEFXFS610 E Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9295FEFXFS630.00FEFXFS327.00FE;
+FS10042FEFXFSDarrenFEFXFSDinklFEFXFSNovus Health GroupFEFXFS1300 E Calumet StFEFXFSSmithvilleFEFXFSAKFEFXFS99903-2099FEFXFS215.00FEFXFS241.00FE;
+FS10067FEFXFSJaneFEFXFSHaugnerFEFXFSO'Donnell PublishingFEFXFS217 Pacific StFEFXFSJonestownFEFXFSAKFEFXFS99911-5713FEFXFS340.00FEFXFS266.00FE;
+FS10029FEFXFSCheriFEFXFSBuksykFEFXFSOffice SupportFEFXFS1122 Milwaukee StFEFXFSJonestownFEFXFSAKFEFXFS99401-4175FEFXFS150.00FEFXFS228.00FE;
+FS10099FEFXFSLoriFEFXFSLudwigFEFXFSPat Woods IncFEFXFS3730 W College AveFEFXFSKimbroFEFXFSAKFEFXFS99914-3920FEFXFS500.00FEFXFS299.00FE;
+FS10086FEFXFSJoyceFEFXFSKretschFEFXFSPhoparFEFXFS3036 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1347FEFXFS435.00FEFXFS285.00FE;
+FS10060FEFXFSGeorgeFEFXFSGibsonFEFXFSPrime Control SystemsFEFXFS1965 Oshkosh AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-4397FEFXFS305.00FEFXFS259.00FE;
+FS10106FEFXFSMaryFEFXFSMickeFEFXFSPrincipal FinancialFEFXFS4301 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915FEFXFS535.00FEFXFS307.00FE;
+FS10075FEFXFSJoanneFEFXFSJensenFEFXFSPrint & MailFX Inc.FEFXFS2301 W Nordale DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911-9106FEFXFS380.00FEFXFS274.00FE;
+FS10095FEFXFSLindaFEFXFSLongFEFXFSPyramid Marketing & AdvertisingFEFXFS3301 W Prospect AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3169FEFXFS480.00FEFXFS295.00FE;
+FS10121FEFXFSNancyFEFXFSReinlFEFXFSQuinlan DentistryFEFXFS525 N Perkins StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9010FEFXFS610.00FEFXFS323.00FE;
+FS10109FEFXFSMaryFEFXFSMuellerFEFXFSRawhide Boys RanchFEFXFS4321 N Ballard RdFEFXFSNew HopeFEFXFSAKFEFXFS99915-1488FEFXFS550.00FEFXFS310.00FE;
+FS10026FEFXFSCallaFEFXFSBoshersFEFXFSSaturn of AppletonFEFXFS110 Fox River DrFEFXFSSmithvilleFEFXFSAKFEFXFS99166-3425FEFXFS135.00FEFXFS225.00FE;
+FS10114FEFXFSMichelleFEFXFSPawlowskiFEFXFSSecura InsuranceFEFXFS4406 W Spencer StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9986FEFXFS575.00FEFXFS315.00FE;
+FS10116FEFXFSMikeFEFXFSPetersFEFXFSSt Mary's Central High SchoolFEFXFS502 W Northland AveFEFXFSDime BoxFEFXFSAKFEFXFS99915-8299FEFXFS585.00FEFXFS317.00FE;
+FS10087FEFXFSJudyFEFXFSKuehlFEFXFSSutherland ElectricFEFXFS3090 Oregon StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1426FEFXFS440.00FEFXFS286.00FE;
+FS10081FEFXFSJohnFEFXFSKarstedtFEFXFSTechLineFEFXFS2662 American DrFEFXFSSmithvilleFEFXFSAKFEFXFS99913-1697FEFXFS410.00FEFXFS280.00FE;
+FS10025FEFXFSButchFEFXFSBobbiFEFXFSTown & Country Electric Inc.FEFXFS108 Hillock CtFEFXFSSmithvilleFEFXFSAKFEFXFS99166-3208FEFXFS130.00FEFXFS224.00FE;
+FS10073FEFXFSJimFEFXFSIssacsonFEFXFSTown of Grand RiverFEFXFS222 E College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5827FEFXFS370.00FEFXFS272.00FE;
+FS10057FEFXFSFatherFEFXFSFreitasFEFXFSTown of VandenbroekFEFXFS1825 N Bluemound DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911-3144FEFXFS290.00FEFXFS256.00FE;
+FS10079FEFXFSJohnFEFXFSJohnsonFEFXFSTwin City Rod & Gun ClubFEFXFS250 Industrial DriveFEFXFSJonestownFEFXFSAKFEFXFS99912-1073FEFXFS400.00FEFXFS278.00FE;
+FS10049FEFXFSDominicFEFXFSEarlFEFXFSUPIUFEFXFS150 W Green Bay RdFEFXFSLonesomeFEFXFSAKFEFXFS99911FEFXFS250.00FEFXFS248.00FE;
+FS10089FEFXFSKayFEFXFSLambertFEFXFSUffenbeck DiamondsFEFXFS319 Main StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1698FEFXFS450.00FEFXFS289.00FE;
+FS10101FEFXFSMarkFEFXFSManclFEFXFSUnited HealthFEFXFS3992 N Richmond StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3989FEFXFS510.00FEFXFS302.00FE;
+FS10065FEFXFSJamesFEFXFSHammerFEFXFSUniversity of WomenFEFXFS212 E College AveFEFXFSOvertonFEFXFSAKFEFXFS99911-9979FEFXFS330.00FEFXFS264.00FE;
+FS10036FEFXFSConnieFEFXFSClayFEFXFSValley Lawn CareFEFXFS121 N Douglas St # RFEFXFSSmithvilleFEFXFSAKFEFXFS99901FEFXFS185.00FEFXFS235.00FE;
+FS10117FEFXFSMikeFEFXFSPhillipsFEFXFSValley PeriodonticsFEFXFS517 N Appleton StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-8288FEFXFS590.00FEFXFS319.00FE;
+FS10034FEFXFSColleenFEFXFSCaspersonFEFXFSValley Trust CorporationFEFXFS120 N Morrison StFEFXFSSmithvilleFEFXFSAKFEFXFS99501FEFXFS175.00FEFXFS233.00FE;
+FS10061FEFXFSGlennFEFXFSGormanFEFXFSVan Vreede'sFEFXFS1990 S Van Dyke RdFEFXFSLittle GorgeFEFXFSAKFEFXFS99911-4708FEFXFS310.00FEFXFS260.00FE;
+FS10040FEFXFSDarleneFEFXFSDantzierFEFXFSWDFFFEFXFS124 W Wisconsin AveFEFXFSDime BoxFEFXFSAKFEFXFS99901-4848FEFXFS205.00FEFXFS239.00FE;
+FS10072FEFXFSJimFEFXFSIckFEFXFSWallach & Assoc.FEFXFS222 E College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5798FEFXFS365.00FEFXFS271.00FE;
+FS10105FEFXFSMartyFEFXFSMeyereFEFXFSWeidert Group IncFEFXFS420 E Longville DrFEFXFSSmithvilleFEFXFSAKFEFXFS99915FEFXFS530.00FEFXFS306.00FE;
+FS10068FEFXFSJeffFEFXFSHennemanFEFXFSWestern IceFEFXFS218 E Lawrence StFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5713FEFXFS345.00FEFXFS267.00FE;
+FS10097FEFXFSLizFEFXFSLonswayFEFXFSWisconsin Tissue Credit UnionFEFXFS333 W College AveFEFXFSJonestownFEFXFSAKFEFXFS99914-3599FEFXFS490.00FEFXFS297.00FE;
+FS10115FEFXFSMikeFEFXFSPeterFEFXFSWitthuhn PrintingFEFXFS4895 Integrity WayFEFXFSSmithvilleFEFXFSAKFEFXFS99915-7802FEFXFS580.00FEFXFS316.00FE;
+FS10107FEFXFSMaryFEFXFSMohrFEFXFSWoodfield SuitesFEFXFS4321 N Ballard RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915FEFXFS540.00FEFXFS308.00FE;
+FS10113FEFXFSMaryFEFXFSPannabakerFEFXFSWorld Wide Auto PartsFEFXFS4321 W College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9951FEFXFS570.00FEFXFS314.00FE;
+FS10066FEFXFSJanFEFXFSHanksFEFXFSYMCAFEFXFS213 Paul DrFEFXFSJonestownFEFXFSAKFEFXFS99911-5712FEFXFS335.00FEFXFS265.00FE;
+FS10119FEFXFSNancyFEFXFSRasmussenFEFXFSYMCA of AppletonFEFXFS520 E Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915-8734FEFXFS600.00FEFXFS321.00FE;
+FS10129FEFXFSMickeyFEFXFSMouseFEFXFSDisneylandFEFXFSMagic KingdomFEFXFSLos AngelesFEFXFSCAFEFXFS94000FEFXFS0.00FEFXFS3.00FE;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt5.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt5.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt5.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,103 @@
+"Account No","First Name","Last Name","Company","Address","City","State","Zip","Last Pymt","Balance";
+"10000","Bugs","Bunny", "Warner Brothers", "Rabbit Hole", "Los Angeles","CA","94001","0.00","10000.00";
+"10039","Dan","Dag","AAL","1222 N Superior St","Smithville","AK","99901-2990","200.00","238.00";
+"10041","Darlene","Dellenmann","AAL","130 E Franklin St","Smithville","AK","99901-7140","210.00","240.00";
+"10043","David","Dockry","AAL","1302 S Ritger","Smithville","AK","99903-2692","220.00","242.00";
+"10050","Don","Ely","AAL","1620 S Lawe St","Smithville","AK","99911","255.00","249.00";
+"10098","Lon","Lowe","AAL","342 W Wisconsin Ave","Smithville","AK","99914-3566","495.00","298.00";
+"10044","Debra","Dorsey","AAL Capital Management","1320 S Lincoln St","Smithville","AK","99903-3065","225.00","243.00";
+"10028","Carol","Braun","AAL Member Credit Union","1115 E Glendale Ave","Smithville","AK","99311-5715","145.00","227.00";
+"10045","Denise","Richardson","AAL Printing/Distribution","1396 Ridgeway Court","Smithville","AK","99911","230.00","244.00";
+"10110","Mary","Mugerauer","Ad Works","4321 N Ballard Rd","Smithville","AK","99915-2241","555.00","311.00";
+"10032","Chuck","Carr","Alpha 1","1151 Valley Fair Mall","Jonestown","AK","99451","165.00","231.00";
+"10080","John","Kamp","American Legion","2600 Stewart Ave # 22","Smithville","AK","99913","405.00","279.00";
+"10070","Jim","Hoppe","Andrews Mautner, Inc.","221 E Atlantic St","Moosetown","AK","99911-5735","355.00","269.00";
+"10083","John","Kolberg","Appleton Area School District","292 Ohio St","Smithville","AK","99913-2019","420.00","282.00";
+"10126","Peg","Russel","Appleton Camping","675 Brighton Beach Rd","Smithville","AK","99915-9701","635.00","328.00";
+"10120","Nancy","Rathman","Appleton Medical Center","525 Enterprise Dr","Smithville","AK","99915-8897","605.00","322.00";
+"10054","Duane","Feavel","Bank One","1818 N Meade St","Smithville","AK","99911-1995","275.00","253.00";
+"10084","John","Korth","Banta Corporate","3000 W Wisconsin Ave","Dime Box","AK","99913-2798","425.00","283.00";
+"10088","Katie","Kusserow","Banta Credit Union","310 Appleton St","Dime Box","AK","99914-1483","445.00","288.00";
+"10027","Carol","Brauer","Bemiss Corp.","110 W North Water St","Jonestown","AK","99216-1144","140.00","226.00";
+"10053","Donna","Esser","Bergstrom Air Force Base","1801 N Richmond St # 12","Jonestown","AK","99911","270.00","252.00";
+"10055","Emmett","Forseth","Bergstrom Enterprises","1818 N Meade St","Smithville","AK","99911-2781","280.00","254.00";
+"10077","Joe","Jirtle","Burton Karstedt","2320 S Memorial Dr","Dime Box","AK","99912-0386","390.00","276.00";
+"10074","Jo Ann","Jahnke","Cabelvision","225 Main St Box # 8003","Smithville","AK","99911-5862","375.00","273.00";
+"10112","Mary Beth","O'Donnell","Counseling Resource Center","4321 N Ballard Rd","Smithville","AK","99915-2421","565.00","313.00";
+"10100","Luke","Madison","Creative Learning International","375 Byrd Ave","Jonestown","AK","99914-3975","505.00","301.00";
+"10092","Larry","Lesperance","Custom Printing","322 N Commercial St","Smithville","AK","99914-1888","465.00","292.00";
+"10082","John","Kitz","Data One Computer Service","2820 N Roemer Rd","Smithville","AK","99913-1936","415.00","281.00";
+"10091","Kevin","Lensby","Derksen Printing","3218 Timothy Ln #6","Overton","AK","99914-1737","460.00","291.00";
+"10111","Mary","Novak","Directions Inc","4321 N Ballard Rd","Jonestown","AK","99915-2401","560.00","312.00";
+"10123","Pam","Richeson","Drucks Plumbing","531 N Main St","Dime Box","AK","99915-9108","620.00","325.00";
+"10030","Chuck","Buss","EAA","1134 S Franklin St","Overton","AK","99401-9903","155.00","229.00";
+"10104","Marti","Merryfield","Enterprise Motors","419 N Oneida St","Smithville","AK","99914-5230","525.00","305.00";
+"10090","Ken","Lamb","Equitable Reserve Association","32122 Paseo Adelanto Ste 2B","Jonestown","AK","99914-1698","455.00","290.00";
+"10103","Marlene","Mentink","Fay Hawkinson & Kruse Inc","411 Lincoln St","Overton","AK","99914-5175","520.00","304.00";
+"10093","Larry","Lindberg","Faye's Fine Jewelry","3232 N Ballard Rd","Jonestown","AK","99914-3121","470.00","293.00";
+"10069","Jeff","Holland","Four D Corporation","2181 W Wisconsin Ave","Appleton","TX","99911-5724","350.00","268.00";
+"10056","Erik","Francken","Fox Cities Bank","1825 N Bluemound Dr","Jonestown","AK","99911-3045","285.00","255.00";
+"10035","Connie","Catterton","Fox Community Credit Union","1200 N Perkins St","Smithville","AK","99901","180.00","234.00";
+"10052","Donna","Erdmann","Fox Valley Technical College","1737 W Reid Dr","Smithville","AK","99911","265.00","251.00";
+"10063","Ingrid","Guyette","Fox Valley Travel","2074 American Dr","Overton","AK","99911-4828","320.00","262.00";
+"10085","John","Kotarek","HRC Inc.","3012 Greenview Dr","Jonestown","AK","99914","430.00","284.00";
+"10094","Linda","Linonofski","Haugners Inc.","33 Park Pl","Smithville","AK","99914-3136","475.00","294.00";
+"10062","Howard","Grennon","Insurance Brokerage Services","200 W College Ave","Smithville","AK","99911-4721","315.00","261.00";
+"10076","Jodi","Jesse","Jewelers Mutual Insurance","231 E College Ave","Jonestown","AK","99912-0235","385.00","275.00";
+"10047","Dick","Dunbar","Ken Gibson Assoc.","1461 Ashland Ave","Smithville","AK","99911","240.00","246.00";
+"10058","Gary","Garvey","Kitz Printing","1909 W 2nd St","Overton","AK","99911-3499","295.00","257.00";
+"10122","Natalie","Reynolds","Klusendorf Chiropractic","528 2nd St","Smithville","AK","99915-9106","615.00","324.00";
+"10038","Dan","Coppenger","Kolosso Toyota","1221 N Lawe St","Smithville","AK","99901-2104","195.00","237.00";
+"10031","Chuck","Carpenter","Kurz Electric","115 S Drew St","Smithville","AK","99433-9418","160.00","230.00";
+"10024","Bruce","Beyer","La Salle Clinic","108 E Wisconsin Ave","Jonestown","AK","99143-1803","125.00","223.00";
+"10071","Jim","Howard","Laser Typesetting","221 W College Ave","Smithville","AK","99911-5770","360.00","270.00";
+"10046","Diane","Duginski","Lawrence University","144 N Mall Dr","Smithville","AK","99911","235.00","245.00";
+"10064","Jacquie","Hagen","M & M Advertising","21 Waugoo Ave","Smithville","AK","99911-9972","325.00","263.00";
+"10023","Bruce","Beecher","Madson & Huth Communication Co","1037 W Wisconsin Ave","Smithville","AK","99140-1599","120.00","222.00";
+"10124","Pat","Robbins","Market Link","557 S Marcella St","Smithville","AK","99915-9210","625.00","326.00";
+"10019","Bobbi","Arndt","Market Place","1000 S Nicolet Rd","Sametown","TX","99136-1221","100.00","218.00";
+"10108","Mary","Mortensen","Master Litho","4321 N Ballard Rd","Jonestown","AK","99915-1429","545.00","309.00";
+"10102","Mark","Melissa","Memorial Florists","408 W Wisconsin Ave","Smithville","AK","99914-4698","515.00","303.00";
+"10048","Dinah","Duxbury","Menasha Employees Credit Union","1486 Earl St","Dime Box","AK","99911","245.00","247.00";
+"10118","Nancy","Rapp","Neenah Printing","520 E Wisconsin Ave","Jonestown","AK","99915-8410","595.00","320.00";
+"10037","Craig","Collar","Network Health Plan","1216 W Wisconsin Ave","Moretown","AK","99901","190.00","236.00";
+"10125","Pat","Roberts","Norandex","610 E Wisconsin Ave","Smithville","AK","99915-9295","630.00","327.00";
+"10042","Darren","Dinkl","Novus Health Group","1300 E Calumet St","Smithville","AK","99903-2099","215.00","241.00";
+"10067","Jane","Haugner","O'Donnell Publishing","217 Pacific St","Jonestown","AK","99911-5713","340.00","266.00";
+"10029","Cheri","Buksyk","Office Support","1122 Milwaukee St","Jonestown","AK","99401-4175","150.00","228.00";
+"10099","Lori","Ludwig","Pat Woods Inc","3730 W College Ave","Kimbro","AK","99914-3920","500.00","299.00";
+"10086","Joyce","Kretsch","Phopar","3036 W Wisconsin Ave","Smithville","AK","99914-1347","435.00","285.00";
+"10060","George","Gibson","Prime Control Systems","1965 Oshkosh Ave","Smithville","AK","99911-4397","305.00","259.00";
+"10106","Mary","Micke","Principal Financial","4301 W Wisconsin Ave","Smithville","AK","99915","535.00","307.00";
+"10075","Joanne","Jensen","Print & Mail, Inc.","2301 W Nordale Dr","Smithville","AK","99911-9106","380.00","274.00";
+"10095","Linda","Long","Pyramid Marketing & Advertising","3301 W Prospect Ave","Smithville","AK","99914-3169","480.00","295.00";
+"10121","Nancy","Reinl","Quinlan Dentistry","525 N Perkins St","Smithville","AK","99915-9010","610.00","323.00";
+"10109","Mary","Mueller","Rawhide Boys Ranch","4321 N Ballard Rd","New Hope","AK","99915-1488","550.00","310.00";
+"10026","Calla","Boshers","Saturn of Appleton","110 Fox River Dr","Smithville","AK","99166-3425","135.00","225.00";
+"10114","Michelle","Pawlowski","Secura Insurance","4406 W Spencer St","Smithville","AK","99915-9986","575.00","315.00";
+"10116","Mike","Peters","St Mary's Central High School","502 W Northland Ave","Dime Box","AK","99915-8299","585.00","317.00";
+"10087","Judy","Kuehl","Sutherland Electric","3090 Oregon St","Smithville","AK","99914-1426","440.00","286.00";
+"10081","John","Karstedt","TechLine","2662 American Dr","Smithville","AK","99913-1697","410.00","280.00";
+"10025","Butch","Bobbi","Town & Country Electric Inc.","108 Hillock Ct","Smithville","AK","99166-3208","130.00","224.00";
+"10073","Jim","Issacson","Town of Grand River","222 E College Ave","Smithville","AK","99911-5827","370.00","272.00";
+"10057","Father","Freitas","Town of Vandenbroek","1825 N Bluemound Dr","Smithville","AK","99911-3144","290.00","256.00";
+"10079","John","Johnson","Twin City Rod & Gun Club","250 Industrial Drive","Jonestown","AK","99912-1073","400.00","278.00";
+"10049","Dominic","Earl","UPIU","150 W Green Bay Rd","Lonesome","AK","99911","250.00","248.00";
+"10089","Kay","Lambert","Uffenbeck Diamonds","319 Main St","Smithville","AK","99914-1698","450.00","289.00";
+"10101","Mark","Mancl","United Health","3992 N Richmond St","Smithville","AK","99914-3989","510.00","302.00";
+"10065","James","Hammer","University of Women","212 E College Ave","Overton","AK","99911-9979","330.00","264.00";
+"10036","Connie","Clay","Valley Lawn Care","121 N Douglas St # R","Smithville","AK","99901","185.00","235.00";
+"10117","Mike","Phillips","Valley Periodontics","517 N Appleton St","Smithville","AK","99915-8288","590.00","319.00";
+"10034","Colleen","Casperson","Valley Trust Corporation","120 N Morrison St","Smithville","AK","99501","175.00","233.00";
+"10061","Glenn","Gorman","Van Vreede's","1990 S Van Dyke Rd","Little Gorge","AK","99911-4708","310.00","260.00";
+"10040","Darlene","Dantzier","WDFF","124 W Wisconsin Ave","Dime Box","AK","99901-4848","205.00","239.00";
+"10072","Jim","Ick","Wallach & Assoc.","222 E College Ave","Smithville","AK","99911-5798","365.00","271.00";
+"10105","Marty","Meyere","Weidert Group Inc","420 E Longville Dr","Smithville","AK","99915","530.00","306.00";
+"10068","Jeff","Henneman","Western Ice","218 E Lawrence St","Smithville","AK","99911-5713","345.00","267.00";
+"10097","Liz","Lonsway","Wisconsin Tissue Credit Union","333 W College Ave","Jonestown","AK","99914-3599","490.00","297.00";
+"10115","Mike","Peter","Witthuhn Printing","4895 Integrity Way","Smithville","AK","99915-7802","580.00","316.00";
+"10107","Mary","Mohr","Woodfield Suites","4321 N Ballard Rd","Smithville","AK","99915","540.00","308.00";
+"10113","Mary","Pannabaker","World Wide Auto Parts","4321 W College Ave","Smithville","AK","99915-9951","570.00","314.00";
+"10066","Jan","Hanks","YMCA","213 Paul Dr","Jonestown","AK","99911-5712","335.00","265.00";
+"10119","Nancy","Rasmussen","YMCA of Appleton","520 E Wisconsin Ave","Smithville","AK","99915-8734","600.00","321.00";
+"10129","Mickey","Mouse","Disneyland","Magic Kingdom","Los Angeles","CA","94000","0.00","3.00";

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt6.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt6.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Alt6.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+"Account No"FieldSep	"First Name"FieldSep	"Last Name"FieldSep	"Company"FieldSep	"Address"FieldSep	"City"FieldSep	"State"FieldSep	"Zip"FieldSep	"Last Pymt"FieldSep	"Balance"ABCFS10000FEFXFSBugsFEFXFSBunnyFEFXFSWarner BrothersFEFXFSRabbit HoleFEFXFS Los AngelesFEFXFSCAFEFXFS94001FEFXFS0.00FEFXFS10000.00FEABCFS10039FEFXFSDanFEFXFSDagFEFXFSAALFEFXFS1222 N Superior StFEFXFSSmithvilleFEFXFSAKFEFXFS99901-2990FEFXFS200.00FEFXFS238.00FEABCFS10041FEFXFSDarleneFEFXFSDellenmannFEFXFSAALFEFXFS130 E Franklin StFEFXFSSmithvilleFEFXFSAKFEFXFS99901-7140FEFXFS210.00FEFXFS240.00FEABCFS10043FEFXFSDavidFEFXFSDockryFEFXFSAALFEFXFS1302 S RitgerFEFXFSSmithvilleFEFXFSAKFEFXFS99903-2692FEFXFS220.00FEFXFS242.00FEABCFS10050FEFXFSDonFEFXFSElyFEFXFSAALFEFXFS1620 S Lawe StFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS255.00FEFXFS249.00FEABCFS10098FEFXFSLonFEFXFSLoweFEFXFSAALFEFXFS342 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3566FEFXFS495.00FEFXFS298.00FEABCFS10044FEFXFSDebraFEFXFSDorseyFEFXFSAAL Capital ManagementFEFXFS1320 S Lincoln StFEFXFSSmithvilleFEFXFSAKFEFXFS99903-3065FEFXFS225.00FEFXFS243.00FEABCFS10028FEFXFSCarolFEFXFSBraunFEFXFSAAL Member Credit UnionFEFXFS1115 E Glendale AveFEFXFSSmithvilleFEFXFSAKFEFXFS99311-5715FEFXFS145.00FEFXFS227.00FEABCFS10045FEFXFSDeniseFEFXFSRichardsonFEFXFSAAL Printing/DistributionFEFXFS1396 Ridgeway CourtFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS230.00FEFXFS244.00FEABCFS10110FEFXFSMaryFEFXFSMugerauerFEFXFSAd WorksFEFXFS4321 N Ballard RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915-2241FEFXFS555.00FEFXFS311.00FEABCFS10032FEFXFSChuckFEFXFSCarrFEFXFSAlpha 1FEFXFS1151 Valley Fair MallFEFXFSJonestownFEFXFSAKFEFXFS99451FEFXFS165.00FEFXFS231.00FEABCFS10080FEFXFSJohnFEFXFSKampFEFXFSAmerican LegionFEFXFS2600 Stewart Ave # 22FEFXFSSmithvilleFEFXFSAKFEFXFS99913FEFXFS405.00FEFXFS279.00FEABCFS10070FEFXFSJimFEFXFSHoppeFEFXFSAndrews MautnerFX Inc.FEFXFS221 E Atlantic StFEFXFSMoosetownFEFXFSAKFEFXFS99911-5735FEFXFS355.00FEFXFS269.00FEABCFS10083FEFXFSJohnFEFXFSKolbergFEFXFSAppleton Area School DistrictFEFXFS292 Ohio StFEFXFSSmithvilleFEFXFSAKFEFXFS99913-2019FEFXFS420.00FEFXFS282.00FEABCFS10126FEFXFSPegFEFXFSRusselFEFXFSAppleton CampingFEFXFS675 Brighton Beach RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9701FEFXFS635.00FEFXFS328.00FEABCFS10120FEFXFSNancyFEFXFSRathmanFEFXFSAppleton Medical CenterFEFXFS525 Enterprise DrFEFXFSSmithvilleFEFXFSAKFEFXFS99915-8897FEFXFS605.00FEFXFS322.00FEABCFS10054FEFXFSDuaneFEFXFSFeavelFEFXFSBank OneFEFXFS1818 N Meade StFEFXFSSmithvilleFEFXFSAKFEFXFS99911-1995FEFXFS275.00FEFXFS253.00FEABCFS10084FEFXFSJohnFEFXFSKorthFEFXFSBanta CorporateFEFXFS3000 W Wisconsin AveFEFXFSDime BoxFEFXFSAKFEFXFS99913-2798FEFXFS425.00FEFXFS283.00FEABCFS10088FEFXFSKatieFEFXFSKusserowFEFXFSBanta Credit UnionFEFXFS310 Appleton StFEFXFSDime BoxFEFXFSAKFEFXFS99914-1483FEFXFS445.00FEFXFS288.00FEABCFS10027FEFXFSCarolFEFXFSBrauerFEFXFSBemiss Corp.FEFXFS110 W North Water StFEFXFSJonestownFEFXFSAKFEFXFS99216-1144FEFXFS140.00FEFXFS226.00FEABCFS10053FEFXFSDonnaFEFXFSEsserFEFXFSBergstrom Air Force BaseFEFXFS1801 N Richmond St # 12FEFXFSJonestownFEFXFSAKFEFXFS99911FEFXFS270.00FEFXFS252.00FEABCFS10055FEFXFSEmmettFEFXFSForsethFEFXFSBergstrom EnterprisesFEFXFS1818 N Meade StFEFXFSSmithvilleFEFXFSAKFEFXFS99911-2781FEFXFS280.00FEFXFS254.00FEABCFS10077FEFXFSJoeFEFXFSJirtleFEFXFSBurton KarstedtFEFXFS2320 S Memorial DrFEFXFSDime BoxFEFXFSAKFEFXFS99912-0386FEFXFS390.00FEFXFS276.00FEABCFS10074FEFXFSJo AnnFEFXFSJahnkeFEFXFSCabelvisionFEFXFS225 Main St Box # 8003FEFXFSSmithvilleFEFXFSAKFEFXFS99911-5862FEFXFS375.00FEFXFS273.00FEABCFS10112FEFXFSMary BethFEFXFSO'DonnellFEFXFSCounseling Resource CenterFEFXFS4321 N Ballard RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915-2421FEFXFS565.00FEFXFS313.00FEABCFS10100FEFXFSLukeFEFXFSMadisonFEFXFSCreative Learning InternationalFEFXFS375 Byrd AveFEFXFSJonestownFEFXFSAKFEFXFS99914-3975FEFXFS505.00FEFXFS301.00FEABCFS10092FEFXFSLarryFEFXFSLesperanceFEFXFSCustom PrintingFEFXFS322 N Commercial StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1888FEFXFS465.00FEFXFS292.00FEABCFS10082FEFXFSJohnFEFXFSKitzFEFXFSData One Computer ServiceFEFXFS2820 N Roemer RdFEFXFSSmithvilleFEFXFSAKFEFXFS99913-1936FEFXFS415.00FEFXFS281.00FEABCFS10091FEFXFSKevinFEFXFSLensbyFEFXFSDerksen PrintingFEFXFS3218 Timothy Ln #6FEFXFSOvertonFEFXFSAKFEFXFS99914-1737FEFXFS460.00FEFXFS291.00FEABCFS10111FEFXFSMaryFEFXFSNovakFEFXFSDirections IncFEFXFS4321 N Ballard RdFEFXFSJonestownFEFXFSAKFEFXFS99915-2401FEFXFS560.00FEFXFS312.00FEABCFS10123FEFXFSPamFEFXFSRichesonFEFXFSDrucks PlumbingFEFXFS531 N Main StFEFXFSDime BoxFEFXFSAKFEFXFS99915-9108FEFXFS620.00FEFXFS325.00FEABCFS10030FEFXFSChuckFEFXFSBussFEFXFSEAAFEFXFS1134 S Franklin StFEFXFSOvertonFEFXFSAKFEFXFS99401-9903FEFXFS155.00FEFXFS229.00FEABCFS10104FEFXFSMartiFEFXFSMerryfieldFEFXFSEnterprise MotorsFEFXFS419 N Oneida StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-5230FEFXFS525.00FEFXFS305.00FEABCFS10090FEFXFSKenFEFXFSLambFEFXFSEquitable Reserve AssociationFEFXFS32122 Paseo Adelanto Ste 2BFEFXFSJonestownFEFXFSAKFEFXFS99914-1698FEFXFS455.00FEFXFS290.00FEABCFS10103FEFXFSMarleneFEFXFSMentinkFEFXFSFay Hawkinson & Kruse IncFEFXFS411 Lincoln StFEFXFSOvertonFEFXFSAKFEFXFS99914-5175FEFXFS520.00FEFXFS304.00FEABCFS10093FEFXFSLarryFEFXFSLindbergFEFXFSFaye's Fine JewelryFEFXFS3232 N Ballard RdFEFXFSJonestownFEFXFSAKFEFXFS99914-3121FEFXFS470.00FEFXFS293.00FEABCFS10069FEFXFSJeffFEFXFSHollandFEFXFSFour D CorporationFEFXFS2181 W Wisconsin AveFEFXFSAppletonFEFXFSTXFEFXFS99911-5724FEFXFS350.00FEFXFS268.00FEABCFS10056FEFXFSErikFEFXFSFranckenFEFXFSFox Cities BankFEFXFS1825 N Bluemound DrFEFXFSJonestownFEFXFSAKFEFXFS99911-3045FEFXFS285.00FEFXFS255.00FEABCFS10035FEFXFSConnieFEFXFSCattertonFEFXFSFox Community Credit UnionFEFXFS1200 N Perkins StFEFXFSSmithvilleFEFXFSAKFEFXFS99901FEFXFS180.00FEFXFS234.00FEABCFS10052FEFXFSDonnaFEFXFSErdmannFEFXFSFox Valley Technical CollegeFEFXFS1737 W Reid DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS265.00FEFXFS251.00FEABCFS10063FEFXFSIngridFEFXFSGuyetteFEFXFSFox Valley TravelFEFXFS2074 American DrFEFXFSOvertonFEFXFSAKFEFXFS99911-4828FEFXFS320.00FEFXFS262.00FEABCFS10085FEFXFSJohnFEFXFSKotarekFEFXFSHRC Inc.FEFXFS3012 Greenview DrFEFXFSJonestownFEFXFSAKFEFXFS99914FEFXFS430.00FEFXFS284.00FEABCFS10094FEFXFSLindaFEFXFSLinonofskiFEFXFSHaugners Inc.FEFXFS33 Park PlFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3136FEFXFS475.00FEFXFS294.00FEABCFS10062FEFXFSHowardFEFXFSGrennonFEFXFSInsurance Brokerage ServicesFEFXFS200 W College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-4721FEFXFS315.00FEFXFS261.00FEABCFS10076FEFXFSJodiFEFXFSJesseFEFXFSJewelers Mutual InsuranceFEFXFS231 E College AveFEFXFSJonestownFEFXFSAKFEFXFS99912-0235FEFXFS385.00FEFXFS275.00FEABCFS10047FEFXFSDickFEFXFSDunbarFEFXFSKen Gibson Assoc.FEFXFS1461 Ashland AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS240.00FEFXFS246.00FEABCFS10058FEFXFSGaryFEFXFSGarveyFEFXFSKitz PrintingFEFXFS1909 W 2nd StFEFXFSOvertonFEFXFSAKFEFXFS99911-3499FEFXFS295.00FEFXFS257.00FEABCFS10122FEFXFSNatalieFEFXFSReynoldsFEFXFSKlusendorf ChiropracticFEFXFS528 2nd StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9106FEFXFS615.00FEFXFS324.00FEABCFS10038FEFXFSDanFEFXFSCoppengerFEFXFSKolosso ToyotaFEFXFS1221 N Lawe StFEFXFSSmithvilleFEFXFSAKFEFXFS99901-2104FEFXFS195.00FEFXFS237.00FEABCFS10031FEFXFSChuckFEFXFSCarpenterFEFXFSKurz ElectricFEFXFS115 S Drew StFEFXFSSmithvilleFEFXFSAKFEFXFS99433-9418FEFXFS160.00FEFXFS230.00FEABCFS10024FEFXFSBruceFEFXFSBeyerFEFXFSLa Salle ClinicFEFXFS108 E Wisconsin AveFEFXFSJonestownFEFXFSAKFEFXFS99143-1803FEFXFS125.00FEFXFS223.00FEABCFS10071FEFXFSJimFEFXFSHowardFEFXFSLaser TypesettingFEFXFS221 W College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5770FEFXFS360.00FEFXFS270.00FEABCFS10046FEFXFSDianeFEFXFSDuginskiFEFXFSLawrence UniversityFEFXFS144 N Mall DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911FEFXFS235.00FEFXFS245.00FEABCFS10064FEFXFSJacquieFEFXFSHagenFEFXFSM & M AdvertisingFEFXFS21 Waugoo AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-9972FEFXFS325.00FEFXFS263.00FEABCFS10023FEFXFSBruceFEFXFSBeecherFEFXFSMadson & Huth Communication CoFEFXFS1037 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99140-1599FEFXFS120.00FEFXFS222.00FEABCFS10124FEFXFSPatFEFXFSRobbinsFEFXFSMarket LinkFEFXFS557 S Marcella StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9210FEFXFS625.00FEFXFS326.00FEABCFS10019FEFXFSBobbiFEFXFSArndtFEFXFSMarket PlaceFEFXFS1000 S Nicolet RdFEFXFSSametownFEFXFSTXFEFXFS99136-1221FEFXFS100.00FEFXFS218.00FEABCFS10108FEFXFSMaryFEFXFSMortensenFEFXFSMaster LithoFEFXFS4321 N Ballard RdFEFXFSJonestownFEFXFSAKFEFXFS99915-1429FEFXFS545.00FEFXFS309.00FEABCFS10102FEFXFSMarkFEFXFSMelissaFEFXFSMemorial FloristsFEFXFS408 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-4698FEFXFS515.00FEFXFS303.00FEABCFS10048FEFXFSDinahFEFXFSDuxburyFEFXFSMenasha Employees Credit UnionFEFXFS1486 Earl StFEFXFSDime BoxFEFXFSAKFEFXFS99911FEFXFS245.00FEFXFS247.00FEABCFS10118FEFXFSNancyFEFXFSRappFEFXFSNeenah PrintingFEFXFS520 E Wisconsin AveFEFXFSJonestownFEFXFSAKFEFXFS99915-8410FEFXFS595.00FEFXFS320.00FEABCFS10037FEFXFSCraigFEFXFSCollarFEFXFSNetwork Health PlanFEFXFS1216 W Wisconsin AveFEFXFSMoretownFEFXFSAKFEFXFS99901FEFXFS190.00FEFXFS236.00FEABCFS10125FEFXFSPatFEFXFSRobertsFEFXFSNorandexFEFXFS610 E Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9295FEFXFS630.00FEFXFS327.00FEABCFS10042FEFXFSDarrenFEFXFSDinklFEFXFSNovus Health GroupFEFXFS1300 E Calumet StFEFXFSSmithvilleFEFXFSAKFEFXFS99903-2099FEFXFS215.00FEFXFS241.00FEABCFS10067FEFXFSJaneFEFXFSHaugnerFEFXFSO'Donnell PublishingFEFXFS217 Pacific StFEFXFSJonestownFEFXFSAKFEFXFS99911-5713FEFXFS340.00FEFXFS266.00FEABCFS10029FEFXFSCheriFEFXFSBuksykFEFXFSOffice SupportFEFXFS1122 Milwaukee StFEFXFSJonestownFEFXFSAKFEFXFS99401-4175FEFXFS150.00FEFXFS228.00FEABCFS10099FEFXFSLoriFEFXFSLudwigFEFXFSPat Woods IncFEFXFS3730 W College AveFEFXFSKimbroFEFXFSAKFEFXFS99914-3920FEFXFS500.00FEFXFS299.00FEABCFS10086FEFXFSJoyceFEFXFSKretschFEFXFSPhoparFEFXFS3036 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1347FEFXFS435.00FEFXFS285.00FEABCFS10060FEFXFSGeorgeFEFXFSGibsonFEFXFSPrime Control SystemsFEFXFS1965 Oshkosh AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-4397FEFXFS305.00FEFXFS259.00FEABCFS10106FEFXFSMaryFEFXFSMickeFEFXFSPrincipal FinancialFEFXFS4301 W Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915FEFXFS535.00FEFXFS307.00FEABCFS10075FEFXFSJoanneFEFXFSJensenFEFXFSPrint & MailFX Inc.FEFXFS2301 W Nordale DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911-9106FEFXFS380.00FEFXFS274.00FEABCFS10095FEFXFSLindaFEFXFSLongFEFXFSPyramid Marketing & AdvertisingFEFXFS3301 W Prospect AveFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3169FEFXFS480.00FEFXFS295.00FEABCFS10121FEFXFSNancyFEFXFSReinlFEFXFSQuinlan DentistryFEFXFS525 N Perkins StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9010FEFXFS610.00FEFXFS323.00FEABCFS10109FEFXFSMaryFEFXFSMuellerFEFXFSRawhide Boys RanchFEFXFS4321 N Ballard RdFEFXFSNew HopeFEFXFSAKFEFXFS99915-1488FEFXFS550.00FEFXFS310.00FEABCFS10026FEFXFSCallaFEFXFSBoshersFEFXFSSaturn of AppletonFEFXFS110 Fox River DrFEFXFSSmithvilleFEFXFSAKFEFXFS99166-3425FEFXFS135.00FEFXFS225.00FEABCFS10114FEFXFSMichelleFEFXFSPawlowskiFEFXFSSecura InsuranceFEFXFS4406 W Spencer StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9986FEFXFS575.00FEFXFS315.00FEABCFS10116FEFXFSMikeFEFXFSPetersFEFXFSSt Mary's Central High SchoolFEFXFS502 W Northland AveFEFXFSDime BoxFEFXFSAKFEFXFS99915-8299FEFXFS585.00FEFXFS317.00FEABCFS10087FEFXFSJudyFEFXFSKuehlFEFXFSSutherland ElectricFEFXFS3090 Oregon StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1426FEFXFS440.00FEFXFS286.00FEABCFS10081FEFXFSJohnFEFXFSKarstedtFEFXFSTechLineFEFXFS2662 American DrFEFXFSSmithvilleFEFXFSAKFEFXFS99913-1697FEFXFS410.00FEFXFS280.00FEABCFS10025FEFXFSButchFEFXFSBobbiFEFXFSTown & Country Electric Inc.FEFXFS108 Hillock CtFEFXFSSmithvilleFEFXFSAKFEFXFS99166-3208FEFXFS130.00FEFXFS224.00FEABCFS10073FEFXFSJimFEFXFSIssacsonFEFXFSTown of Grand RiverFEFXFS222 E College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5827FEFXFS370.00FEFXFS272.00FEABCFS10057FEFXFSFatherFEFXFSFreitasFEFXFSTown of VandenbroekFEFXFS1825 N Bluemound DrFEFXFSSmithvilleFEFXFSAKFEFXFS99911-3144FEFXFS290.00FEFXFS256.00FEABCFS10079FEFXFSJohnFEFXFSJohnsonFEFXFSTwin City Rod & Gun ClubFEFXFS250 Industrial DriveFEFXFSJonestownFEFXFSAKFEFXFS99912-1073FEFXFS400.00FEFXFS278.00FEABCFS10049FEFXFSDominicFEFXFSEarlFEFXFSUPIUFEFXFS150 W Green Bay RdFEFXFSLonesomeFEFXFSAKFEFXFS99911FEFXFS250.00FEFXFS248.00FEABCFS10089FEFXFSKayFEFXFSLambertFEFXFSUffenbeck DiamondsFEFXFS319 Main StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-1698FEFXFS450.00FEFXFS289.00FEABCFS10101FEFXFSMarkFEFXFSManclFEFXFSUnited HealthFEFXFS3992 N Richmond StFEFXFSSmithvilleFEFXFSAKFEFXFS99914-3989FEFXFS510.00FEFXFS302.00FEABCFS10065FEFXFSJamesFEFXFSHammerFEFXFSUniversity of WomenFEFXFS212 E College AveFEFXFSOvertonFEFXFSAKFEFXFS99911-9979FEFXFS330.00FEFXFS264.00FEABCFS10036FEFXFSConnieFEFXFSClayFEFXFSValley Lawn CareFEFXFS121 N Douglas St # RFEFXFSSmithvilleFEFXFSAKFEFXFS99901FEFXFS185.00FEFXFS235.00FEABCFS10117FEFXFSMikeFEFXFSPhillipsFEFXFSValley PeriodonticsFEFXFS517 N Appleton StFEFXFSSmithvilleFEFXFSAKFEFXFS99915-8288FEFXFS590.00FEFXFS319.00FEABCFS10034FEFXFSColleenFEFXFSCaspersonFEFXFSValley Trust CorporationFEFXFS120 N Morrison StFEFXFSSmithvilleFEFXFSAKFEFXFS99501FEFXFS175.00FEFXFS233.00FEABCFS10061FEFXFSGlennFEFXFSGormanFEFXFSVan Vreede'sFEFXFS1990 S Van Dyke RdFEFXFSLittle GorgeFEFXFSAKFEFXFS99911-4708FEFXFS310.00FEFXFS260.00FEABCFS10040FEFXFSDarleneFEFXFSDantzierFEFXFSWDFFFEFXFS124 W Wisconsin AveFEFXFSDime BoxFEFXFSAKFEFXFS99901-4848FEFXFS205.00FEFXFS239.00FEABCFS10072FEFXFSJimFEFXFSIckFEFXFSWallach & Assoc.FEFXFS222 E College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5798FEFXFS365.00FEFXFS271.00FEABCFS10105FEFXFSMartyFEFXFSMeyereFEFXFSWeidert Group IncFEFXFS420 E Longville DrFEFXFSSmithvilleFEFXFSAKFEFXFS99915FEFXFS530.00FEFXFS306.00FEABCFS10068FEFXFSJeffFEFXFSHennemanFEFXFSWestern IceFEFXFS218 E Lawrence StFEFXFSSmithvilleFEFXFSAKFEFXFS99911-5713FEFXFS345.00FEFXFS267.00FEABCFS10097FEFXFSLizFEFXFSLonswayFEFXFSWisconsin Tissue Credit UnionFEFXFS333 W College AveFEFXFSJonestownFEFXFSAKFEFXFS99914-3599FEFXFS490.00FEFXFS297.00FEABCFS10115FEFXFSMikeFEFXFSPeterFEFXFSWitthuhn PrintingFEFXFS4895 Integrity WayFEFXFSSmithvilleFEFXFSAKFEFXFS99915-7802FEFXFS580.00FEFXFS316.00FEABCFS10107FEFXFSMaryFEFXFSMohrFEFXFSWoodfield SuitesFEFXFS4321 N Ballard RdFEFXFSSmithvilleFEFXFSAKFEFXFS99915FEFXFS540.00FEFXFS308.00FEABCFS10113FEFXFSMaryFEFXFSPannabakerFEFXFSWorld Wide Auto PartsFEFXFS4321 W College AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915-9951FEFXFS570.00FEFXFS314.00FEABCFS10066FEFXFSJanFEFXFSHanksFEFXFSYMCAFEFXFS213 Paul DrFEFXFSJonestownFEFXFSAKFEFXFS99911-5712FEFXFS335.00FEFXFS265.00FEABCFS10119FEFXFSNancyFEFXFSRasmussenFEFXFSYMCA of AppletonFEFXFS520 E Wisconsin AveFEFXFSSmithvilleFEFXFSAKFEFXFS99915-8734FEFXFS600.00FEFXFS321.00FEABCFS10129FEFXFSMickeyFEFXFSMouseFEFXFSDisneylandFEFXFSMagic KingdomFEFXFSLos AngelesFEFXFSCAFEFXFS94000FEFXFS0.00FEFXFS3.00FEABC

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/EndOfFile.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/EndOfFile.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/EndOfFile.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2 @@
+"10000","Bugs","Bunny", "Warner Brothers", "  -- Rabbit Hole -- ", "Los Angeles","CA","94001","0.00","100.00"
+"10019","Bobbi","Arndt","Market Place","1000 S Nicolet Rd"

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor1.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor1.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor1.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,102 @@
+"10000","Bugs","Bunny", "Warner Brothers", "  -- Rabbit Hole -- ", "Los Angeles","CA","94001","0.00","100.00"
+"10019","Bobbi","Arndt","Market Place","1000 S Nicolet Rd","Sametown","TX","99136-1221","100.00","218.00"
+"10023","Bruce","Beecher","Madson & Huth Communication Co","1037 W Wisconsin Ave","Smithville","AK","99140-1599","120.00","222.00"
+"10024","Bruce","Beyer","La Salle Clinic","108 E Wisconsin Ave","Jonestown","AK","99143-1803","125.00","223.00"
+"10025","Butch","Bobbi","Town & Country Electric Inc.","108 Hillock Ct","Smithville","AK","99166-3208","130.00","224.00"
+"10026","Calla","Boshers","Saturn of Appleton","110 Fox River Dr","Smithville","AK","99166-3425","135.00","225.00"
+"10027","Carol","Brauer","Bemiss Corp.","110 W North Water St","Jonestown","AK","99216-1144","140.00","226.00"
+"10028","Carol","Braun","AAL Member Credit Union","1115 E Glendale Ave","Smithville","AK","99311-5715","145.00","227.00"
+"10029","Cheri","Buksyk","Office Support","1122 Milwaukee St","Jonestown","AK","99401-4175","150.00","228.00"
+"10030","Chuck","Buss","EAA","1134 S Franklin St","Overton","AK","99401-9903","155.00","229.00"
+"10031","Chuck","Carpenter","Kurz Electric","115 S Drew St","Smithville","AK","99433-9418","160.00","230.00"
+"10032","Chuck","Carr","Alpha 1","1151 Valley Fair Mall","Jonestown","AK","99451","165.00","231.00"
+"10034","Colleen","Casperson","Valley Trust Corporation","120 N Morrison St","Smithville","AK","99501","175.00","233.00"
+"10035","Connie","Catterton","Fox Community Credit Union","1200 N Perkins St","Smithville","AK","99901","180.00","234.00"
+"10036","Connie","Clay","Valley Lawn Care","121 N Douglas St # R","Smithville","AK","99901","185.00","235.00"
+"10037","Craig","Collar","Network Health Plan","1216 W Wisconsin Ave","Moretown","AK","99901","190.00","236.00"
+"10038","Dan","Coppenger","Kolosso Toyota","1221 N Lawe St","Smithville","AK","99901-2104","195.00","237.00"
+"10039","Dan","Dag","AAL","1222 N Superior St","Smithville","AK","99901-2990","200.00","238.00"
+"10040","Darlene","Dantzier","WDFF","124 W Wisconsin Ave","Dime Box","AK","99901-4848","205.00","239.00"
+"10041","Darlene","Dellenmann","AAL","130 E Franklin St","Smithville","AK","99901-7140","210.00","240.00"
+"10042","Darren","Dinkl","Novus Health Group","1300 E Calumet St","Smithville","AK","99903-2099","215.00","241.00"
+"10043","David","Dockry","AAL","1302 S Ritger","Smithville","AK","99903-2692","220.00","242.00"
+"10044","Debra","Dorsey","AAL Capital Management","1320 S Lincoln St","Smithville","AK","99903-3065","225.00","243.00"
+"10045","Denise","Richardson","AAL Printing/Distribution","1396 Ridgeway Court","Smithville","AK","99911","230.00","244.00"
+"10046","Diane","Duginski","Lawrence University","144 N Mall Dr","Smithville","AK","99911","235.00","245.00"
+"10047","Dick","Dunbar","Ken Gibson Assoc.","1461 Ashland Ave","Smithville","AK","99911","240.00","246.00"
+"10048","Dinah","Duxbury","Menasha Employees Credit Union","1486 Earl St","Dime Box","AK","99911","245.00","247.00"
+"10049","Dominic","Earl","UPIU","150 W Green Bay Rd","Lonesome","AK","99911","250.00","248.00"
+"10050","Don","Ely","AAL","1620 S Lawe St","Smithville","AK","99911","255.00","249.00"
+"10052","Donna","Erdmann","Fox Valley Technical College","1737 W Reid Dr","Smithville","AK","99911","265.00","251.00"
+"10053","Donna","Esser","Bergstrom Air Force Base","1801 N Richmond St # 12","Jonestown","AK","99911","270.00","252.00"
+"10054","Duane","Feavel","Bank One","1818 N Meade St","Smithville","AK","99911-1995","275.00","253.00"
+"10055","Emmett","Forseth","Bergstrom Enterprises","1818 N Meade St","Smithville","AK","99911-2781","280.00","254.00"
+"10056","Erik","Francken","Fox Cities Bank","1825 N Bluemound Dr","Jonestown","AK","99911-3045","285.00","255.00"
+"10057","Father","Freitas","Town of Vandenbroek","1825 N Bluemound Dr","Smithville","AK","99911-3144","290.00","256.00"
+"10058","Gary","Garvey","Kitz Printing","1909 W 2nd St","Overton","AK","99911-3499","295.00","257.00"
+"10060","George","Gibson","Prime Control Systems","1965 Oshkosh Ave","Smithville","AK","99911-4397","305.00","259.00"
+"10061","Glenn","Gorman","Van Vreede's","1990 S Van Dyke Rd","Little Gorge","AK","99911-4708","310.00","260.00"
+"10062","Howard","Grennon","Insurance Brokerage Services","200 W College Ave","Smithville","AK","99911-4721","315.00","261.00"
+"10063","Ingrid","Guyette","Fox Valley Travel","2074 American Dr","Overton","AK","99911-4828","320.00","262.00"
+"10064","Jacquie","Hagen","M & M Advertising","21 Waugoo Ave","Smithville","AK","99911-9972","325.00","263.00"
+"10065","James","Hammer","University of Women","212 E College Ave","Overton","AK","99911-9979","330.00","264.00"
+"10066","Jan","Hanks","YMCA","213 Paul Dr","Jonestown","AK","99911-5712","335.00","265.00"
+"10067","Jane","Haugner","O'Donnell Publishing","217 Pacific St","Jonestown","AK","99911-5713","340.00","266.00"
+"10068","Jeff","Henneman","Western Ice","218 E Lawrence St","Smithville","AK","99911-5713","345.00","267.00"
+"10069","Jeff","Holland","Four D Corporation","2181 W Wisconsin Ave","Appleton","TX","99911-5724","350.00","268.00"
+"10070","Jim","Hoppe","Andrews Mautner, Inc.","221 E Atlantic St","Moosetown","AK","99911-5735","355.00","269.00"
+"10071","Jim","Howard","Laser Typesetting","221 W College Ave","Smithville","AK","99911-5770","360.00","270.00"
+"10072","Jim","Ick","Wallach & Assoc.","222 E College Ave","Smithville","AK","99911-5798","365.00","271.00"
+"10073","Jim","Issacson","Town of Grand River","222 E College Ave","Smithville","AK","99911-5827","370.00","272.00"
+"10074","Jo Ann","Jahnke","Cabelvision","225 Main St Box # 8003","Smithville","AK","99911-5862","375.00","273.00"
+"10075","Joanne","Jensen","Print & Mail, Inc.","2301 W Nordale Dr","Smithville","AK","99911-9106","380.00","274.00"
+"10076","Jodi","Jesse","Jewelers Mutual Insurance","231 E College Ave","Jonestown","AK","99912-0235","385.00","275.00"
+"10077","Joe","Jirtle","Burton Karstedt","2320 S Memorial Dr","Dime Box","AK","99912-0386","390.00","276.00"
+"10079","John","Johnson","Twin City Rod & Gun Club","250 Industrial Drive","Jonestown","AK","99912-1073","400.00","278.00"
+"10080","John","Kamp","American Legion","2600 Stewart Ave # 22","Smithville","AK","99913","405.00","279.00"
+"10081","John","Karstedt","TechLine","2662 American Dr","Smithville","AK","99913-1697","410.00","280.00"
+"10082","John","Kitz","Data One Computer Service","2820 N Roemer Rd","Smithville","AK","99913-1936","415.00","281.00"
+"10083","John","Kolberg","Appleton Area School District","292 Ohio St","Smithville","AK","99913-2019","420.00","282.00"
+"10084","John","Korth","Banta Corporate","3000 W Wisconsin Ave","Dime Box","AK","99913-2798","425.00","283.00"
+"10085","John","Kotarek","HRC Inc.","3012 Greenview Dr","Jonestown","AK","99914","430.00","284.00"
+"10086","Joyce","Kretsch","Phopar","3036 W Wisconsin Ave","Smithville","AK","99914-1347","435.00","285.00"
+"10087","Judy","Kuehl","Sutherland Electric","3090 Oregon St","Smithville","AK","99914-1426","440.00","286.00"
+"10088","Katie","Kusserow","Banta Credit Union","310 Appleton St","Dime Box","AK","99914-1483","445.00","288.00"
+"10089","Kay","Lambert","Uffenbeck Diamonds","319 Main St","Smithville","AK","99914-1698","450.00","289.00"
+"10090","Ken","Lamb","Equitable Reserve Association","32122 Paseo Adelanto Ste 2B","Jonestown","AK","99914-1698","455.00","290.00"
+"10091","Kevin","Lensby","Derksen Printing","3218 Timothy Ln #6","Overton","AK","99914-1737","460.00","291.00"
+"10092","Larry","Lesperance","Custom Printing","322 N Commercial St","Smithville","AK","99914-1888","465.00","292.00"
+"10093","Larry","Lindberg","Faye's Fine Jewelry","3232 N Ballard Rd","Jonestown","AK","99914-3121","470.00","293.00"
+"10094","Linda","Linonofski","Haugners Inc.","33 Park Pl","Smithville","AK","99914-3136","475.00","294.00"
+"10095","Linda","Long","Pyramid Marketing & Advertising","3301 W Prospect Ave","Smithville","AK","99914-3169","480.00","295.00"
+"10097","Liz","Lonsway","Wisconsin Tissue Credit Union","333 W College Ave","Jonestown","AK","99914-3599","490.00","297.00"
+"10098","Lon","Lowe","AAL","342 W Wisconsin Ave","Smithville","AK","99914-3566","495.00","298.00"
+"10099","Lori","Ludwig","Pat Woods Inc","3730 W College Ave","Kimbro","AK","99914-3920","500.00","299.00"
+"10100","Luke","Madison","Creative Learning International","375 Byrd Ave","Jonestown","AK","99914-3975","505.00","301.00"
+"10101","Mark","Mancl","United Health","3992 N Richmond St","Smithville","AK","99914-3989","510.00","302.00"
+"10102","Mark","Melissa","Memorial Florists","408 W Wisconsin Ave","Smithville","AK","99914-4698","515.00","303.00"
+"10103","Marlene","Mentink","Fay Hawkinson & Kruse Inc","411 Lincoln St","Overton","AK","99914-5175","520.00","304.00"
+"10104","Marti","Merryfield","Enterprise Motors","419 N Oneida St","Smithville","AK","99914-5230","525.00","305.00"
+"10105","Marty","Meyere","Weidert Group Inc","420 E Longville Dr","Smithville","AK","99915","530.00","306.00"
+"10106","Mary","Micke","Principal Financial","4301 W Wisconsin Ave","Smithville","AK","99915","535.00","307.00"
+"10107","Mary","Mohr","Woodfield Suites","4321 N Ballard Rd","Smithville","AK","99915","540.00","308.00"
+"10108","Mary","Mortensen","Master Litho","4321 N Ballard Rd","Jonestown","AK","99915-1429","545.00","309.00"
+"10109","Mary","Mueller","Rawhide Boys Ranch","4321 N Ballard Rd","New Hope","AK","99915-1488","550.00","310.00"
+"10110","Mary","Mugerauer","Ad Works","4321 N Ballard Rd","Smithville","AK","99915-2241","555.00","311.00"
+"10111","Mary","Novak","Directions Inc","4321 N Ballard Rd","Jonestown","AK","99915-2401","560.00","312.00"
+"10112","Mary Beth","O'Donnell","Counseling Resource Center","4321 N Ballard Rd","Smithville","AK","99915-2421","565.00","313.00"
+"10113","Mary","Pannabaker","World Wide Auto Parts","4321 W College Ave","Smithville","AK","99915-9951","570.00","314.00"
+"10114","Michelle","Pawlowski","Secura Insurance","4406 W Spencer St","Smithville","AK","99915-9986","575.00","315.00"
+"10115","Mike","Peter","Witthuhn Printing","4895 Integrity Way","Smithville","AK","99915-7802","580.00","316.00"
+"10116","Mike","Peters","St Mary's Central High School","502 W Northland Ave","Dime Box","AK","99915-8299","585.00","317.00"
+"10117","Mike","Phillips","Valley Periodontics","517 N Appleton St","Smithville","AK","99915-8288","590.00","319.00"
+"10118","Nancy","Rapp","Neenah Printing","520 E Wisconsin Ave","Jonestown","AK","99915-8410","595.00","320.00"
+"10119","Nancy","Rasmussen","YMCA of Appleton","520 E Wisconsin Ave","Smithville","AK","99915-8734","600.00","321.00"
+"10120","Nancy","Rathman","Appleton Medical Center","525 Enterprise Dr","Smithville","AK","99915-8897","605.00","322.00"
+"10121","Nancy","Reinl","Quinlan Dentistry","525 N Perkins St","Smithville","AK","99915-9010","610.00","323.00"
+"10122","Natalie","Reynolds","Klusendorf Chiropractic","528 2nd St","Smithville","AK","99915-9106","615.00","324.00"
+"10123","Pam","Richeson","Drucks Plumbing","531 N Main St","Dime Box","AK","99915-9108","620.00","325.00"
+"10124","Pat","Robbins","Market Link","557 S Marcella St","Smithville","AK","99915-9210","625.00","326.00"
+"10125","Pat","Roberts","Norandex","610 E Wisconsin Ave","Smithville","AK","99915-9295","630.00","327.00"
+"10126","Peg","Russel","Appleton Camping","675 Brighton Beach Rd","Smithville","AK","99915-9701","635.00","328.00"
+"10129","Mickey","Mouse","Disneyland","Magic Kingdom  ","Los Angeles","CA","94000","0.00","1.00"

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor2.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor2.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor2.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,101 @@
+     10000Bugs      Bunny     Warner Brothers                Rabbit Hole                Los Angeles CA   94001         0.00 1000.00
+     10019Bobbi     Arndt     Market Place                   1000 S Nicolet Rd          Sametown    TX   99136-1221  100.00  218.00
+     10023Bruce     Beecher   Madson & Huth Communication Co 1037 W Wisconsin Ave       Smithville  AK   99140-1599  120.00  222.00
+     10024Bruce     Beyer     La Salle Clinic                108 E Wisconsin Ave        Jonestown   AK   99143-1803  125.00  223.00
+     10025Butch     Bobbi     Town & Country Electric Inc.   108 Hillock Ct             Smithville  AK   99166-3208  130.00  224.00
+     10026Calla     Boshers   Saturn of Appleton             110 Fox River Dr           Smithville  AK   99166-3425  135.00  225.00
+     10027Carol     Brauer    Bemiss Corp.                   110 W North Water St       Jonestown   AK   99216-1144  140.00  226.00
+     10028Carol     Braun     AAL Member Credit Union        1115 E Glendale Ave        Smithville  AK   99311-5715  145.00  227.00
+     10029Cheri     Buksyk    Office Support                 1122 Milwaukee St          Jonestown   AK   99401-4175  150.00  228.00
+     10030Chuck     Buss      EAA                            1134 S Franklin St         Overton     AK   99401-9903  155.00  229.00
+     10031Chuck     Carpenter Kurz Electric                  115 S Drew St              Smithville  AK   99433-9418  160.00  230.00
+     10032Chuck     Carr      Alpha 1                        1151 Valley Fair Mall      Jonestown   AK   99451       165.00  231.00
+     10034Colleen   Casperson Valley Trust Corporation       120 N Morrison St          Smithville  AK   99501       175.00  233.00
+     10035Connie    Catterton Fox Community Credit Union     1200 N Perkins St          Smithville  AK   99901       180.00  234.00
+     10036Connie    Clay      Valley Lawn Care               121 N Douglas St # R       Smithville  AK   99901       185.00  235.00
+     10037Craig     Collar    Network Health Plan            1216 W Wisconsin Ave       Moretown    AK   99901       190.00  236.00
+     10038Dan       Coppenger Kolosso Toyota                 1221 N Lawe St             Smithville  AK   99901-2104  195.00  237.00
+     10039Dan       Dag       AAL                            1222 N Superior St         Smithville  AK   99901-299018200.2212238.99
+     10040Darlene   Dantzier  WDFF                           124 W Wisconsin Ave        Dime Box    AK   99901-4848  205.00  239.00
+     10041Darlene   DellenmannAAL                            130 E Franklin St          Smithville  AK   99901-7140  210.00  240.00
+     10042Darren    Dinkl     Novus Health Group             1300 E Calumet St          Smithville  AK   99903-2099  215.00  241.00
+     10043David     Dockry    AAL                            1302 S Ritger              Smithville  AK   99903-2692  220.00  242.00
+     10044Debra     Dorsey    AAL Capital Management         1320 S Lincoln St          Smithville  AK   99903-3065  225.00  243.00
+     10045Denise    RichardsonAAL Printing/Distribution      1396 Ridgeway Court        Smithville  AK   99911       230.00  244.00
+     10046Diane     Duginski  Lawrence University            144 N Mall Dr              Smithville  AK   99911         5.00 -245.00
+     10047Dick      Dunbar    Ken Gibson Assoc.              1461 Ashland Ave           Smithville  AK   99911       240.00  246.00
+     10048Dinah     Duxbury   Menasha Employees Credit Union 1486 Earl St               Dime Box    AK   99911       245.00  247.00
+     10049Dominic   Earl      UPIU                           150 W Green Bay Rd         Lonesome    AK   99911       250.00  248.00
+     10050Don       Ely       AAL                            1620 S Lawe St             Smithville  AK   99911       255.00  249.00
+     10052Donna     Erdmann   Fox Valley Technical College   1737 W Reid Dr             Smithville  AK   99911       265.00  251.00
+     10053Donna     Esser     Bergstrom Air Force Base       1801 N Richmond St # 12    Jonestown   AK   99911       270.00  252.00
+     10054Duane     Feavel    Bank One                       1818 N Meade St            Smithville  AK   99911-1995  275.00  253.00
+     10055Emmett    Forseth   Bergstrom Enterprises          1818 N Meade St            Smithville  AK   99911-2781  280.00  254.00
+     10056Erik      Francken  Fox Cities Bank                1825 N Bluemound Dr        Jonestown   AK   99911-3045  285.00  255.00
+     10057Father    Freitas   Town of Vandenbroek            1825 N Bluemound Dr        Smithville  AK   99911-3144   90.0012256.00
+     10058Gary      Garvey    Kitz Printing                  1909 W 2nd St              Overton     AK   99911-3499  295.00  257.00
+     10060George    Gibson    Prime Control Systems          1965 Oshkosh Ave           Smithville  AK   99911-4397  305.00  259.00
+     10061Glenn     Gorman    Van Vreede's                   1990 S Van Dyke Rd         Little GorgeAK   99911-4708  310.00  260.00
+     10062Howard    Grennon   Insurance Brokerage Services   200 W College Ave          Smithville  AK   99911-4721  315.00  261.00
+     10063Ingrid    Guyette   Fox Valley Travel              2074 American Dr           Overton     AK   99911-4828  320.00  262.00
+     10064Jacquie   Hagen     M & M Advertising              21 Waugoo Ave              Smithville  AK   99911-9972  325.00  263.00
+     10065James     Hammer    University of Women            212 E College Ave          Overton     AK   99911-9979  330.00  264.00
+     10066Jan       Hanks     YMCA                           213 Paul Dr                Jonestown   AK   99911-5712  335.00  265.00
+     10067Jane      Haugner   O'Donnell Publishing           217 Pacific St             Jonestown   AK   99911-5713  340.00  266.00
+     10068Jeff      Henneman  Western Ice                    218 E Lawrence St          Smithville  AK   99911-5713  345.00  267.00
+     10069Jeff      Holland   Four D Corporation             2181 W Wisconsin Ave       Appleton    TX   99911-5724  350.00  268.00
+     10070Jim       Hoppe     Andrews Mautner, Inc.          221 E Atlantic St          Moosetown   AK   99911-5735  355.00  269.00
+     10071Jim       Howard    Laser Typesetting              221 W College Ave          Smithville  AK   99911-5770  360.00  270.00
+     10072Jim       Ick       Wallach & Assoc.               222 E College Ave          Smithville  AK   99911-5798  365.00  271.00
+     10073Jim       Issacson  Town of Grand River            222 E College Ave          Smithville  AK   99911-5827  370.00  272.00
+     10074Jo Ann    Jahnke    Cabelvision                    225 Main St Box # 8003     Smithville  AK   99911-5862  375.00  273.00
+     10075Joanne    Jensen    Print & Mail, Inc.             2301 W Nordale Dr          Smithville  AK   99911-9106  380.00  274.00
+     10076Jodi      Jesse     Jewelers Mutual Insurance      231 E College Ave          Jonestown   AK   99912-0235  385.00  275.00
+     10077Joe       Jirtle    Burton Karstedt                2320 S Memorial Dr         Dime Box    AK   99912-0386  390.00  276.00
+     10079John      Johnson   Twin City Rod & Gun Club       250 Industrial Drive       Jonestown   AK   99912-1073  400.00  278.00
+     10080John      Kamp      American Legion                2600 Stewart Ave # 22      Smithville  AK   99913       405.00  279.00
+     10081John      Karstedt  TechLine                       2662 American Dr           Smithville  AK   99913-1697  410.00  280.00
+     10082John      Kitz      Data One Computer Service      2820 N Roemer Rd           Smithville  AK   99913-1936  415.00  281.00
+     10083John      Kolberg   Appleton Area School District  292 Ohio St                Smithville  AK   99913-2019  420.00  282.00
+     10084John      Korth     Banta Corporate                3000 W Wisconsin Ave       Dime Box    AK   99913-2798  425.00  283.00
+     10085John      Kotarek   HRC Inc.                       3012 Greenview Dr          Jonestown   AK   99914       430.00  284.00
+     10086Joyce     Kretsch   Phopar                         3036 W Wisconsin Ave       Smithville  AK   99914-1347  435.00  285.00
+     10087Judy      Kuehl     Sutherland Electric            3090 Oregon St             Smithville  AK   99914-1426  440.00  286.00
+     10088Katie     Kusserow  Banta Credit Union             310 Appleton St            Dime Box    AK   99914-1483  445.00  288.00
+     10089Kay       Lambert   Uffenbeck Diamonds             319 Main St                Smithville  AK   99914-1698  450.00  289.00
+     10090Ken       Lamb      Equitable Reserve Association  32122 Paseo Adelanto Ste 2BJonestown   AK   99914-1698  455.00  290.00
+     10091Kevin     Lensby    Derksen Printing               3218 Timothy Ln #6         Overton     AK   99914-1737  460.00  291.00
+     10092Larry     LesperanceCustom Printing                322 N Commercial St        Smithville  AK   99914-1888  465.00  292.00
+     10093Larry     Lindberg  Faye's Fine Jewelry            3232 N Ballard Rd          Jonestown   AK   99914-3121  470.00  293.00
+     10094Linda     LinonofskiHaugners Inc.                  33 Park Pl                 Smithville  AK   99914-3136  475.00  294.00
+     10095Linda     Long      Pyramid Marketing & Advertising3301 W Prospect Ave        Smithville  AK   99914-3169  480.00  295.00
+     10097Liz       Lonsway   Wisconsin Tissue Credit Union  333 W College Ave          Jonestown   AK   99914-3599  490.00  297.00
+     10098Lon       Lowe      AAL                            342 W Wisconsin Ave        Smithville  AK   99914-3566  495.00  298.00
+     10099Lori      Ludwig    Pat Woods Inc                  3730 W College Ave         Kimbro      AK   99914-3920  500.00  299.00
+     10100Luke      Madison   Creative Learning International375 Byrd Ave               Jonestown   AK   99914-3975  505.00  301.00
+     10101Mark      Mancl     United Health                  3992 N Richmond St         Smithville  AK   99914-3989  510.00  302.00
+     10102Mark      Melissa   Memorial Florists              408 W Wisconsin Ave        Smithville  AK   99914-4698  515.00  303.00
+     10103Marlene   Mentink   Fay Hawkinson & Kruse Inc      411 Lincoln St             Overton     AK   99914-5175  520.00  304.00
+     10104Marti     MerryfieldEnterprise Motors              419 N Oneida St            Smithville  AK   99914-5230  525.00  305.00
+     10105Marty     Meyere    Weidert Group Inc              420 E Longville Dr         Smithville  AK   99915       530.00  306.00
+     10106Mary      Micke     Principal Financial            4301 W Wisconsin Ave       Smithville  AK   99915       535.00  307.00
+     10107Mary      Mohr      Woodfield Suites               4321 N Ballard Rd          Smithville  AK   99915       540.00  308.00
+     10108Mary      Mortensen Master Litho                   4321 N Ballard Rd          Jonestown   AK   99915-1429  545.00  309.00
+     10109Mary      Mueller   Rawhide Boys Ranch             4321 N Ballard Rd          New Hope    AK   99915-1488  550.00    0.00
+     10110Mary      Mugerauer Ad Works                       4321 N Ballard Rd          Smithville  AK   99915-2241  555.00  311.00
+     10111Mary      Novak     Directions Inc                 4321 N Ballard Rd          Jonestown   AK   99915-2401  560.00  312.00
+     10112Mary Beth O'Donnell Counseling Resource Center     4321 N Ballard Rd          Smithville  AK   99915-2421  565.00  313.00
+     10113Mary      PannabakerWorld Wide Auto Parts          4321 W College Ave         Smithville  AK   99915-9951  570.00  314.00
+     10114Michelle  Pawlowski Secura Insurance               4406 W Spencer St          Smithville  AK   99915-9986  575.00  315.00
+     10115Mike      Peter     Witthuhn Printing              4895 Integrity Way         Smithville  AK   99915-7802  580.00  316.00
+     10116Mike      Peters    St Mary's Central High School  502 W Northland Ave        Dime Box    AK   99915-8299  585.00  317.00
+     10117Mike      Phillips  Valley Periodontics            517 N Appleton St          Smithville  AK   99915-8288  590.00  319.00
+     10118Nancy     Rapp      Neenah Printing                520 E Wisconsin Ave        Jonestown   AK   99915-8410  595.00  320.00
+     10119Nancy     Rasmussen YMCA of Appleton               520 E Wisconsin Ave        Smithville  AK   99915-8734  600.00  321.00
+     10120Nancy     Rathman   Appleton Medical Center        525 Enterprise Dr          Smithville  AK   99915-8897  605.00  322.00
+     10121Nancy     Reinl     Quinlan Dentistry              525 N Perkins St           Smithville  AK   99915-9010  610.00  323.00
+     10122Natalie   Reynolds  Klusendorf Chiropractic        528 2nd St                 Smithville  AK   99915-9106  615.00  324.00
+     10123Pam       Richeson  Drucks Plumbing                531 N Main St              Dime Box    AK   99915-9108  620.00  325.00
+     10124Pat       Robbins   Market Link                    557 S Marcella St          Smithville  AK   99915-9210  625.00  326.00
+     10125Pat       Roberts   Norandex                       610 E Wisconsin Ave        Smithville  AK   99915-9295  630.00  327.00
+     10129Mickey    Mouse     Disneyland                     Magic Kingdom              Los Angeles CA   94000         0.00    2.00

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor3.asc
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor3.asc?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/Tutor3.asc	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,102 @@
+"10000","Bugs","Bunny", "Warner Brothers", "Rabbit Hole", "Los Angeles","CA","94001","0.00","10000.00"
+"10039","Dan","Dag","AAL","1222 N Superior St","Smithville","AK","99901-2990","200.00","238.00"
+"10041","Darlene","Dellenmann","AAL","130 E Franklin St","Smithville","AK","99901-7140","210.00","240.00"
+"10043","David","Dockry","AAL","1302 S Ritger","Smithville","AK","99903-2692","220.00","242.00"
+"10050","Don","Ely","AAL","1620 S Lawe St","Smithville","AK","99911","255.00","249.00"
+"10098","Lon","Lowe","AAL","342 W Wisconsin Ave","Smithville","AK","99914-3566","495.00","298.00"
+"10044","Debra","Dorsey","AAL Capital Management","1320 S Lincoln St","Smithville","AK","99903-3065","225.00","243.00"
+"10028","Carol","Braun","AAL Member Credit Union","1115 E Glendale Ave","Smithville","AK","99311-5715","145.00","227.00"
+"10045","Denise","Richardson","AAL Printing/Distribution","1396 Ridgeway Court","Smithville","AK","99911","230.00","244.00"
+"10110","Mary","Mugerauer","Ad Works","4321 N Ballard Rd","Smithville","AK","99915-2241","555.00","311.00"
+"10032","Chuck","Carr","Alpha 1","1151 Valley Fair Mall","Jonestown","AK","99451","165.00","231.00"
+"10080","John","Kamp","American Legion","2600 Stewart Ave # 22","Smithville","AK","99913","405.00","279.00"
+"10070","Jim","Hoppe","Andrews Mautner, Inc.","221 E Atlantic St","Moosetown","AK","99911-5735","355.00","269.00"
+"10083","John","Kolberg","Appleton Area School District","292 Ohio St","Smithville","AK","99913-2019","420.00","282.00"
+"10126","Peg","Russel","Appleton Camping","675 Brighton Beach Rd","Smithville","AK","99915-9701","635.00","328.00"
+"10120","Nancy","Rathman","Appleton Medical Center","525 Enterprise Dr","Smithville","AK","99915-8897","605.00","322.00"
+"10054","Duane","Feavel","Bank One","1818 N Meade St","Smithville","AK","99911-1995","275.00","253.00"
+"10084","John","Korth","Banta Corporate","3000 W Wisconsin Ave","Dime Box","AK","99913-2798","425.00","283.00"
+"10088","Katie","Kusserow","Banta Credit Union","310 Appleton St","Dime Box","AK","99914-1483","445.00","288.00"
+"10027","Carol","Brauer","Bemiss Corp.","110 W North Water St","Jonestown","AK","99216-1144","140.00","226.00"
+"10053","Donna","Esser","Bergstrom Air Force Base","1801 N Richmond St # 12","Jonestown","AK","99911","270.00","252.00"
+"10055","Emmett","Forseth","Bergstrom Enterprises","1818 N Meade St","Smithville","AK","99911-2781","280.00","254.00"
+"10077","Joe","Jirtle","Burton Karstedt","2320 S Memorial Dr","Dime Box","AK","99912-0386","390.00","276.00"
+"10074","Jo Ann","Jahnke","Cabelvision","225 Main St Box # 8003","Smithville","AK","99911-5862","375.00","273.00"
+"10112","Mary Beth","O'Donnell","Counseling Resource Center","4321 N Ballard Rd","Smithville","AK","99915-2421","565.00","313.00"
+"10100","Luke","Madison","Creative Learning International","375 Byrd Ave","Jonestown","AK","99914-3975","505.00","301.00"
+"10092","Larry","Lesperance","Custom Printing","322 N Commercial St","Smithville","AK","99914-1888","465.00","292.00"
+"10082","John","Kitz","Data One Computer Service","2820 N Roemer Rd","Smithville","AK","99913-1936","415.00","281.00"
+"10091","Kevin","Lensby","Derksen Printing","3218 Timothy Ln #6","Overton","AK","99914-1737","460.00","291.00"
+"10111","Mary","Novak","Directions Inc","4321 N Ballard Rd","Jonestown","AK","99915-2401","560.00","312.00"
+"10123","Pam","Richeson","Drucks Plumbing","531 N Main St","Dime Box","AK","99915-9108","620.00","325.00"
+"10030","Chuck","Buss","EAA","1134 S Franklin St","Overton","AK","99401-9903","155.00","229.00"
+"10104","Marti","Merryfield","Enterprise Motors","419 N Oneida St","Smithville","AK","99914-5230","525.00","305.00"
+"10090","Ken","Lamb","Equitable Reserve Association","32122 Paseo Adelanto Ste 2B","Jonestown","AK","99914-1698","455.00","290.00"
+"10103","Marlene","Mentink","Fay Hawkinson & Kruse Inc","411 Lincoln St","Overton","AK","99914-5175","520.00","304.00"
+"10093","Larry","Lindberg","Faye's Fine Jewelry","3232 N Ballard Rd","Jonestown","AK","99914-3121","470.00","293.00"
+"10069","Jeff","Holland","Four D Corporation","2181 W Wisconsin Ave","Appleton","TX","99911-5724","350.00","268.00"
+"10056","Erik","Francken","Fox Cities Bank","1825 N Bluemound Dr","Jonestown","AK","99911-3045","285.00","255.00"
+"10035","Connie","Catterton","Fox Community Credit Union","1200 N Perkins St","Smithville","AK","99901","180.00","234.00"
+"10052","Donna","Erdmann","Fox Valley Technical College","1737 W Reid Dr","Smithville","AK","99911","265.00","251.00"
+"10063","Ingrid","Guyette","Fox Valley Travel","2074 American Dr","Overton","AK","99911-4828","320.00","262.00"
+"10085","John","Kotarek","HRC Inc.","3012 Greenview Dr","Jonestown","AK","99914","430.00","284.00"
+"10094","Linda","Linonofski","Haugners Inc.","33 Park Pl","Smithville","AK","99914-3136","475.00","294.00"
+"10062","Howard","Grennon","Insurance Brokerage Services","200 W College Ave","Smithville","AK","99911-4721","315.00","261.00"
+"10076","Jodi","Jesse","Jewelers Mutual Insurance","231 E College Ave","Jonestown","AK","99912-0235","385.00","275.00"
+"10047","Dick","Dunbar","Ken Gibson Assoc.","1461 Ashland Ave","Smithville","AK","99911","240.00","246.00"
+"10058","Gary","Garvey","Kitz Printing","1909 W 2nd St","Overton","AK","99911-3499","295.00","257.00"
+"10122","Natalie","Reynolds","Klusendorf Chiropractic","528 2nd St","Smithville","AK","99915-9106","615.00","324.00"
+"10038","Dan","Coppenger","Kolosso Toyota","1221 N Lawe St","Smithville","AK","99901-2104","195.00","237.00"
+"10031","Chuck","Carpenter","Kurz Electric","115 S Drew St","Smithville","AK","99433-9418","160.00","230.00"
+"10024","Bruce","Beyer","La Salle Clinic","108 E Wisconsin Ave","Jonestown","AK","99143-1803","125.00","223.00"
+"10071","Jim","Howard","Laser Typesetting","221 W College Ave","Smithville","AK","99911-5770","360.00","270.00"
+"10046","Diane","Duginski","Lawrence University","144 N Mall Dr","Smithville","AK","99911","235.00","245.00"
+"10064","Jacquie","Hagen","M & M Advertising","21 Waugoo Ave","Smithville","AK","99911-9972","325.00","263.00"
+"10023","Bruce","Beecher","Madson & Huth Communication Co","1037 W Wisconsin Ave","Smithville","AK","99140-1599","120.00","222.00"
+"10124","Pat","Robbins","Market Link","557 S Marcella St","Smithville","AK","99915-9210","625.00","326.00"
+"10019","Bobbi","Arndt","Market Place","1000 S Nicolet Rd","Sametown","TX","99136-1221","100.00","218.00"
+"10108","Mary","Mortensen","Master Litho","4321 N Ballard Rd","Jonestown","AK","99915-1429","545.00","309.00"
+"10102","Mark","Melissa","Memorial Florists","408 W Wisconsin Ave","Smithville","AK","99914-4698","515.00","303.00"
+"10048","Dinah","Duxbury","Menasha Employees Credit Union","1486 Earl St","Dime Box","AK","99911","245.00","247.00"
+"10118","Nancy","Rapp","Neenah Printing","520 E Wisconsin Ave","Jonestown","AK","99915-8410","595.00","320.00"
+"10037","Craig","Collar","Network Health Plan","1216 W Wisconsin Ave","Moretown","AK","99901","190.00","236.00"
+"10125","Pat","Roberts","Norandex","610 E Wisconsin Ave","Smithville","AK","99915-9295","630.00","327.00"
+"10042","Darren","Dinkl","Novus Health Group","1300 E Calumet St","Smithville","AK","99903-2099","215.00","241.00"
+"10067","Jane","Haugner","O'Donnell Publishing","217 Pacific St","Jonestown","AK","99911-5713","340.00","266.00"
+"10029","Cheri","Buksyk","Office Support","1122 Milwaukee St","Jonestown","AK","99401-4175","150.00","228.00"
+"10099","Lori","Ludwig","Pat Woods Inc","3730 W College Ave","Kimbro","AK","99914-3920","500.00","299.00"
+"10086","Joyce","Kretsch","Phopar","3036 W Wisconsin Ave","Smithville","AK","99914-1347","435.00","285.00"
+"10060","George","Gibson","Prime Control Systems","1965 Oshkosh Ave","Smithville","AK","99911-4397","305.00","259.00"
+"10106","Mary","Micke","Principal Financial","4301 W Wisconsin Ave","Smithville","AK","99915","535.00","307.00"
+"10075","Joanne","Jensen","Print & Mail, Inc.","2301 W Nordale Dr","Smithville","AK","99911-9106","380.00","274.00"
+"10095","Linda","Long","Pyramid Marketing & Advertising","3301 W Prospect Ave","Smithville","AK","99914-3169","480.00","295.00"
+"10121","Nancy","Reinl","Quinlan Dentistry","525 N Perkins St","Smithville","AK","99915-9010","610.00","323.00"
+"10109","Mary","Mueller","Rawhide Boys Ranch","4321 N Ballard Rd","New Hope","AK","99915-1488","550.00","310.00"
+"10026","Calla","Boshers","Saturn of Appleton","110 Fox River Dr","Smithville","AK","99166-3425","135.00","225.00"
+"10114","Michelle","Pawlowski","Secura Insurance","4406 W Spencer St","Smithville","AK","99915-9986","575.00","315.00"
+"10116","Mike","Peters","St Mary's Central High School","502 W Northland Ave","Dime Box","AK","99915-8299","585.00","317.00"
+"10087","Judy","Kuehl","Sutherland Electric","3090 Oregon St","Smithville","AK","99914-1426","440.00","286.00"
+"10081","John","Karstedt","TechLine","2662 American Dr","Smithville","AK","99913-1697","410.00","280.00"
+"10025","Butch","Bobbi","Town & Country Electric Inc.","108 Hillock Ct","Smithville","AK","99166-3208","130.00","224.00"
+"10073","Jim","Issacson","Town of Grand River","222 E College Ave","Smithville","AK","99911-5827","370.00","272.00"
+"10057","Father","Freitas","Town of Vandenbroek","1825 N Bluemound Dr","Smithville","AK","99911-3144","290.00","256.00"
+"10079","John","Johnson","Twin City Rod & Gun Club","250 Industrial Drive","Jonestown","AK","99912-1073","400.00","278.00"
+"10049","Dominic","Earl","UPIU","150 W Green Bay Rd","Lonesome","AK","99911","250.00","248.00"
+"10089","Kay","Lambert","Uffenbeck Diamonds","319 Main St","Smithville","AK","99914-1698","450.00","289.00"
+"10101","Mark","Mancl","United Health","3992 N Richmond St","Smithville","AK","99914-3989","510.00","302.00"
+"10065","James","Hammer","University of Women","212 E College Ave","Overton","AK","99911-9979","330.00","264.00"
+"10036","Connie","Clay","Valley Lawn Care","121 N Douglas St # R","Smithville","AK","99901","185.00","235.00"
+"10117","Mike","Phillips","Valley Periodontics","517 N Appleton St","Smithville","AK","99915-8288","590.00","319.00"
+"10034","Colleen","Casperson","Valley Trust Corporation","120 N Morrison St","Smithville","AK","99501","175.00","233.00"
+"10061","Glenn","Gorman","Van Vreede's","1990 S Van Dyke Rd","Little Gorge","AK","99911-4708","310.00","260.00"
+"10040","Darlene","Dantzier","WDFF","124 W Wisconsin Ave","Dime Box","AK","99901-4848","205.00","239.00"
+"10072","Jim","Ick","Wallach & Assoc.","222 E College Ave","Smithville","AK","99911-5798","365.00","271.00"
+"10105","Marty","Meyere","Weidert Group Inc","420 E Longville Dr","Smithville","AK","99915","530.00","306.00"
+"10068","Jeff","Henneman","Western Ice","218 E Lawrence St","Smithville","AK","99911-5713","345.00","267.00"
+"10097","Liz","Lonsway","Wisconsin Tissue Credit Union","333 W College Ave","Jonestown","AK","99914-3599","490.00","297.00"
+"10115","Mike","Peter","Witthuhn Printing","4895 Integrity Way","Smithville","AK","99915-7802","580.00","316.00"
+"10107","Mary","Mohr","Woodfield Suites","4321 N Ballard Rd","Smithville","AK","99915","540.00","308.00"
+"10113","Mary","Pannabaker","World Wide Auto Parts","4321 W College Ave","Smithville","AK","99915-9951","570.00","314.00"
+"10066","Jan","Hanks","YMCA","213 Paul Dr","Jonestown","AK","99911-5712","335.00","265.00"
+"10119","Nancy","Rasmussen","YMCA of Appleton","520 E Wisconsin Ave","Smithville","AK","99915-8734","600.00","321.00"
+"10129","Mickey","Mouse","Disneyland","Magic Kingdom","Los Angeles","CA","94000","0.00","3.00"

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/copyfiles.ant?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/copyfiles.ant	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,18 @@
+Access1.txt
+Access2.txt
+Access3.txt
+Alt1.asc
+Alt2.asc
+Alt3.asc
+Alt4.asc
+Alt5.asc
+Alt6.asc
+EndOfFile.txt
+Tutor1.asc
+Tutor2.asc
+Tutor3.asc
+db2ttypes.del
+mixednl.del
+position_info.del
+sqlAnywhere1.txt
+sqlAnywhere2.txt

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/db2ttypes.del
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/db2ttypes.del?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/db2ttypes.del	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,25 @@
+20040406&%10.33.02%&%2004-04-06-10.33.02.434000%
+20040406&%10.34.13%&%2004-04-06-10.34.13.576000%
+20040406&%10.34.14%&%2004-04-06-10.34.14.898000%
+20040406&%10.34.15%&%2004-04-06-10.34.15.939000%
+20040406&%11.01.13%&%2004-04-06-11.01.13.315000%
+20040406&%11.01.14%&%2004-04-06-11.01.14.687000%
+20040406&%11.01.15%&%2004-04-06-11.01.15.749000%
+20040406&%11.01.16%&%2004-04-06-11.01.16.660000%
+20040406&%11.01.17%&%2004-04-06-11.01.17.501000%
+20040406&%11.01.18%&%2004-04-06-11.01.18.232000%
+20040406&%11.01.18%&%2004-04-06-11.01.18.873000%
+20040406&%11.01.19%&%2004-04-06-11.01.19.554000%
+20040406&%11.01.20%&%2004-04-06-11.01.20.275000%
+20040406&%11.01.20%&%2004-04-06-11.01.20.956000%
+20040406&%11.01.21%&%2004-04-06-11.01.21.557000%
+20040406&%11.01.22%&%2004-04-06-11.01.22.138000%
+20040406&%11.01.22%&%2004-04-06-11.01.22.729000%
+20040406&%11.01.23%&%2004-04-06-11.01.23.350000%
+20040406&%11.01.23%&%2004-04-06-11.01.23.920000%
+20040406&%11.01.24%&%2004-04-06-11.01.24.471000%
+20040406&%11.01.25%&%2004-04-06-11.01.25.002000%
+20040406&%11.01.25%&%2004-04-06-11.01.25.553000%
+20040406&%11.01.26%&%2004-04-06-11.01.26.043000%
+20040406&%11.01.26%&%2004-04-06-11.01.26.554000%
+20040406&%11.01.27%&%2004-04-06-11.01.27.526000%

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/mixednl.del
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/mixednl.del?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/mixednl.del	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+0,XXXXXX0
1,XXXXXX1
2,XXXXXX2
3,XXXXXX3
4,XXXXXX4
5,YYYYY5
+6,YYYYY6
+7,YYYYY7
+8,YYYYY8
+9,YYYYY9
+10,ZZZZZZ10
+11,ZZZZZZ11
+12,ZZZZZZ12
+13,ZZZZZZ13
+14,ZZZZZZ14

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/position_info.del
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/position_info.del?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/position_info.del	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1726 @@
+"AG1000",32474,"BUSN","Assist the agriculture director and the Operations manager in fulfilling various administrative, secretarial and organizational duties and tasks as related to leading the agriculture department.","Essential Duties and Responsibilities (include but not limited to):
+*Assist the director in his work activities in leading the agriculture department.
+*Assist in the printing and organizing of teaching and discipling materials for field, workshop and seminar use.  
+*Assist in the development and distribution of communications and public relations information which represents the heart, mission and vision of the department.  
+*Assist in the plans, preparation, and coordination of outreach activities for the department. 
+*Attend and participate in the weekly departmental, and ""community"" prayer, devotional, fellowship and worship times.
+*Be willing to cross-train into the other areas of the department.*Be available to help fellow workers with their tasks during critical need times. 
+ 
+Qualifications (Knowledge, Skills, and Abilities): 
+*Administrative, organizational and computer skills.
+*Exhibiting friendly people skills when answering the phone and interfacing with people. 
+*Ability to define problems, collect data, establish facts, and draw valid conclusions. *Ability to interpret an extensive variety of instructions.
+*Ability to do basic math calculations.
+*Ability to read, analyze, and interpret general business periodicals, reports, and office memos.   
+Ability to write reports and business correspondence, and procedure manuals.  
+Ability to effectively present information and respond to questions from groups, managers, staff, students, and the general public.
+
+Education and Experience:
+Must have successfully completed and met all expectations set forth by the Human Resources Department. 
+
+Work Environment:
+Office environment.Includes exposure to cash. The employee must have the ability to climb, bend, stoop, kneel, sit for long periods of time, work at a computer. The position requires the ability to occasionally lift equipment weighing up to 10 pounds.    
+","Y"
+"AG1001",32478,"RVDF","To provide leadership support and direction for the personnel and the activities of the Agriculture Department.","*Direct, facilitate and represent the overall mission and vision of the Agriculture Department.
+*Represent the Agriculture Department to Mercy Ships mission as a whole.  This involves  leadership, teaching and discipleship roles.
+*Raise local community awareness and involvement in our work in agriculture development.
+*Raise national awareness and involvement in our work in agriculture development.
+*Listen to, encourage, and assist staff in defining their vision, and facilitate them toward that vision.
+*Encourage the agriculture staff in their relationship with God as they serve in the mission.
+*Give leadership to and participate  in the development of the training farm, leading toward God's intentions, as it supports the mission and vision of the overall ministry.
+*Provide support and direction in the working relationships among the agriculture staff, and in the interdepartmental areas of the department. 
+*Make financial decisions within the scope of authority, referring questions to the Vice President of Support Operations
+
+SUPERVISORY RESPONSIBILITIES 
+Supervise Agriculture Department staff, including, administrative assistant, agriculture operations manager, discipleship and training coordinator, outreach/field staff, outreach coordinator, unit coordinators for goats, sheep, cattle, hay/crop production, small animals, garden and marketing/communications.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+Ability to define problems, collect data, establish facts, and draw valid conclusions.  Ability to interpret an extensive variety of instructions.
+Ability to read, analyze, and interpret general business periodicals, reports, and office memos.   
+Ability to write reports and business correspondence, and procedure manuals.  
+Ability to effectively present information and respond to questions from groups, managers, staff, students, and the general public.
+Ability to do basic math calculations.
+
+Education and Experience:
+Must have successfully completed a DTS/CDTS, FCD,  and met all expectations set forth by the Human Resource Department.  Bachelor's Degree (B.A.) from a four year college or university, or two to four years training and/or experience in agriculture.  A Biblical world-view of agriculture and land stewardship.
+
+Work Environment:
+Ability to work in a physically demanding environment.  While performing the duties of this job, the employee is frequently required to stand and walk.  The employee must occasionally lift and/or move up to 50 pounds.  Specific vision abilities required by this job include close vision, and ability to adjust  focus. This job also includes working in an office environment.  The employee must have the ability to sit for long periods of time and work at a computer.
+","Y"
+"AG1002",32487,"RVDF","To provide oversight, support and direction for the daily operations and activities of the Agriculture Training Center, its farm, and related components of the operations of the Agriculture department.","*Oversee, participate and facilitate the daily activities of the agriculture department and training farm. 
+*Assist the director in  representing the overall mission and vision of the Agriculture Department.
+*Listen to, encourage, and assist staff in defining their goals for their particular area of responsibility and facilitate them towards that goal as it supports the mission and vision of the agriculture department.
+*Participate in the development of the training farm, moving it towards Gods intentions as it supports the mission and vision of the ministry.
+*Make financial decisions within the scope of authority, referring questions to the Agriculture Director.
+*Provide support and direction in the working relationships among the staff, and in the interdepartmental areas of the farm exercising good people management and facilitation skills. 
+*Cooperate and communicate with the facilities department regarding daily maintenance and equipment usage of those tools and equipment that overlap departments.  ( tractors, mowers, etc. )
+*Provide input and guidance to various staff in regards to specific job related skills (ie.  animal health, harvest schedule, plant health, etc )
+*Attend and participate in weekly departmental and community prayer, devotional, fellowship, and worship times.
+*Supervise Agriculture Department training farm staff unit coordinators for goats, sheep, cattle, hay/crop production, greenhouse, small animals, orchard, garden and marketing/communications.  
+*Supervise or facilitate supervision of other volunteers and student workers assigned to the Agriculture Department training farm. 
+
+Qualifications (Knowledge, Skills, and Abilities): 
+*Ability to interpret an extensive variety of instructions and deal with several abstract and concrete values.
+*Ability to interpret an extensive variety of instructions.Ability lead and facilitate people.Ability to understand and prepare budgets for the various agriculture department enterprises. 
+*Ability to define problems, collect data, establish facts, and draw valid conclusions. Ability to read, analyze, and interpret general business periodicals, reports, and office memos.   
+*Ability to write reports and business correspondence.
+*Ability to do basic math calculations.
+
+Education and Experience:
+Must have successfully completed a DTS/CDTS,  FCD suggested, and met all expectations set forth by the Human Resource Department.  Four to six years training and/or experience in agriculture.  A Biblical perspective of agriculture, food production and land stewardship.
+
+Work Environment:
+Ability to work in a physically demanding environment.
+","Y"
+"AG1003",32488,"RVDF","Assisting in various areas of the Farm and Agriculture Department.  (Vegetable garden appropriate technologies, various maintenance projects, special projects as assigned).  Helps maintain agriculture department buildings, facilities and equipment.","*Prepares soil, plants and cultivates garden plants such as tomatoes, peppers, lettuce, beans, etc. in a sustainable and renewable way, using organic practices and methods.
+*Pursue the discovery and demonstrate better ways to grow plants for development work in Christian Missions.
+*Helps harvest garden produce.
+*Collect data and document research trials or other pertinent information.  
+*Feeds, waters and cares for animals according to schedules when assigned.
+*Helps maintain agriculture department buildings, facilities, equipment, fences etc.
+*Periodically cleans and disinfects cages, pens and yards.
+*Repairs cages, pens or fenced areas.
+*Builds, maintains or repairs various facilities, equipment, or tools used by the department. 
+*Attaches farm implements to tractor and drives tractor in fields to perform work assignment.
+*Lubricates, adjusts, and makes minor repairs on farm machinery, implements, and equipment.
+*Attend and participate in weekly departmental and community prayer, devotional, fellowship, and worship times.*Be willing to cross-train in other areas of the department.
+*Be available to help fellow workers with their tasks during critical need times.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+*Ability to do basic math calculations
+*Ability to read and to interpret an extensive variety of instructions
+*Ability to write reports
+
+Education and Experience:
+Must have successfully completed and met all expectations set forth by the Personnel Department. 
+
+Work Environment:
+Ability to work in a physically demanding environment
+","Y"
+"AG1004",32489,"RVDF","Assist with the various activities and projects within the agriculture department. ","*Prepare soil, plant and cultivate garden plants, such as tomatoes, peppers, lettuce, beans, etc. in a sustainable and renewable way, using organic practices and methods.
+*Helps harvest garden produce.
+*Collect data and document research trials or other pertinent information.  
+*Feeds, waters and cares for animals according to schedules.
+*Cleans and disinfects cages and pens. 
+*Completes various routine maintenance tasks as needed in relation to daily operations.
+*Attend and participate in the weekly departmental, and ""community"" prayer, devotional, fellowship and worship times.
+*Incorporate agriculture development practices in your  work at Mercy Ships.
+*Be willing to cross-train into the other areas of the department.
+*Be available to help fellow workers with their tasks during critical need times.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+*Ability to do basic math calculations*Ability to read and to interpret an extensive variety of instructions*Ability to write reports
+*Ability to effectively present information and respond to questions from groups, managers, staff, students, and the general public.
+*Desire to learn to define problems, collect data, establish facts, and draw valid conclusions.
+
+Education and Experience:
+Must have successfully completed and met all expectations set forth by the Personnel Department. 
+
+Work Environment:
+Ability to work in a physically demanding environment
+","Y"
+"AG1005",32490,"RVDF","none","none","Y"
+"IT501",31956,"IT01","None
+","None","Y"
+"IT500",31957,"IT01","None
+","None","Y"
+"IT201",31958,"IT01","None","None","Y"
+"IT202",31959,"IT01","None","None","Y"
+"IT210",31960,"IT01","None
+","None","Y"
+"IT220",31961,"IT01","None","None","Y"
+"IT401",31962,"IT01","None","None","Y"
+"IT411",31963,"IT01","None","None","Y"
+"IT215",31964,"IT01","DESCRIPTION:	
+-  Formulates and defines system scope and objectives for assigned projects.   
+-  Devises or modifies procedures to solve complex problems considering: 
+   -  Tools and systems available within Mercy Ships IT strategy  
+   -  Computer equipment capacity and limitations 
+   -  Operating time and form of desired results   
+-  Prepares detailed specifications from which programs will be written.   
+-  Responsible for program design, coding, testing, debugging and documentation.   
+-  Has full technical knowledge of all phases of applications systems analysis and programming.   
+-  Has good understanding of the business or function for which applications are designed.   
+-  Responsible for quality assurance review.   
+-  Responsible for project completion and user satisfaction.	","REPORTS TO: Software Development Manager
+
+DESCRIPTION:	
+-  Formulates and defines system scope and objectives for assigned projects.   
+-  Devises or modifies procedures to solve complex problems considering: 
+  -  Tools and systems available within Mercy Ships IT strategy  
+  -  Computer equipment capacity and limitations 
+  -  Operating time and form of desired results   
+-  Prepares detailed specifications from which programs will be written.   
+-  Responsible for program design, coding, testing, debugging and documentation.   
+-  Has full technical knowledge of all phases of applications systems analysis and programming.   
+-  Has good understanding of the business or function for which applications are designed.   
+-  Responsible for quality assurance review.   
+-  Responsible for project completion and user satisfaction.	
+
+POSITION SCOPE:	
+Work can include any or all of the following systems/architechtures: 
+-  PC-based 
+-  Client-Server 
+-  Web: Servlets 
+-  Database	
+
+SOURCES OF TECHNICAL SUPPORT:	
+-  Independent Research 
+-  Direct Supervisor 
+-  Peers 
+-  Vendors and Consultants	
+
+SCOPE OF IMPACT:	
+-  Successful execution of this job will provide excellent IT systems for Mercy Ships staff, ultimately making the organization more efficient and effective. 
+-  Unsuccessful execution of this job will mean that Mercy Ships does not have adequate IT systems and therefore does not capitalize on opportunities for increased organizational efficiency and effectiveness.	
+
+SUPERVISION AND DIRECTION:	
+-  General supervision is required to set priorities and assign/manage projects 
+-  Technical supervision is required to determine system architechture and toolset 
+-  General direction will be set by IT management as specified by Mercy Ships IT stragegy and policy. 
+-  Business strategy must be discovered through work with the functional area for which a system is being designed. 
+-  Independent work is required within the bounds of the above constraints.	
+
+EDUCATION/WORK EXPERIENCE:	
+-  Bachelor's degree or equivalent training and experience is required. 
+-  Three or more years of industry experience is highly desireable.	
+
+SKILLS:
+This job requires: 
+-  System and business analysis skills 
+-  Design skills 
+-  System development skills 
+-  Testing skills 
+-  System implementation skills 
+-  Project management skills 
+-  Task management skills 
+-  Advanced problem solving skills","Y"
+"IT402",31965,"IT01","None","None","Y"
+"IT321",31966,"IT01","None","None","Y"
+"IT311",31967,"IT01","None","None","Y"
+"IT301",31968,"IT01","None	","None","Y"
+"IT302",31969,"IT01","None	","None","Y"
+"IT331",31970,"IT01","Is first point of contact for remote individual users and National Office staff and will monitor daily inter-site activity.
+","Reports To:  Chief Technical Officer
+
+ESSENTIAL DUTIES AND RESPONSIBILITIES  include the following. Other duties may be assigned.
+
+Is first point of contact for remote individual users (eg Field Reps.) and National Office staff - especially where they have no local technical assistance. Will also monitor daily inter-site activity.
+
+With an understanding of ministry standards and user requirements, prepares & configures hardware for delivery.  Performs installation or removal of hardware and peripheral components such as modems, network cards, printers, hard drives, memory, etc.
+
+Loads, updates, and configures specified software such as hardware drivers, communications packages, LAN settings, and dial-up networking.
+
+Diagnoses system hardware, software, network, and operator problems.  Recommends or performs minor remedial actions to correct problems based on knowledge of system operation.
+
+Refers major hardware, software, problems to appropriate team members for action.
+
+Answers client's inquiries via telephone, email, or IM concerning trouble calls.
+Provides basic user-level training on hardware and software.
+
+Documents and updates equipment hardware specifications and software version records.  Maintain and manage the corporate Dial-up service(s).
+
+Communicate self and Mercy Ships to current and prospective supporters.
+
+Develop personal professional skills.
+
+QUALIFICATIONS  The requirements listed below are representative of the knowledge, skill, and/or ability required. Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.  Allowance will be made for those who wish to grow into the position.  Functional working knowledge of Win9X, Win2K, Unix, and Linux.  Ability to establish and manage Microsoft windows policies.  Ability to configure, manage and maintain a Samba environment.  Must have rudimentary SQL and shell script usage / development skills in a Linux/Unix environment.  The ability to relate to users and technicians is essential.
+
+EDUCATION and/or EXPERIENCE   Bachelor of Computer Science, or three to four years experience in a related field.
+
+LANGUAGE SKILLS:  Ability to read, analyze, and interpret technical manuals and legal documents.  Ability to respond clearly both verbally and in writing to common inquiries or complaints from customers or members  of the community.
+
+REASONING ABILITY: Ability to define problems, collect data, establish facts, and draw valid conclusions.  Ability to interpret an extensive variety of technical instructions and deal with several abstract and concrete variables.
+
+
+
+","Y"
+"IT502",31971,"IT01","None
+","None","Y"
+"IT421",31972,"IT01","None","None","Y"
+"IT101",31973,"IT01","The Chief Information Officer (CIO) heads the group that maintains, identifies, develops and deploys IT systems. The CIO is ultimately responsible for all Information Technology (IT) systems within Mercy Ships at all locations.","Essential Duties and Responsibilities (include but not limited to):
+- The CIO will be responsible for leading the group that maintains and supports existing IT systems (email, web servers, databases, applications, servers, networks, satellite systems, PCs, printers, laptops, etc�).
+- The CIO will evaluate the ongoing usefulness of existing IT systems against Mercy Ships business needs and processes.
+- The CIO will evaluate and make decisions on the usefulness of new technologies and opportunities that may serve to advance the primary goals of Mercy Ships, seeking to integrate new technologies into Mercy Ships business processes as appropriate.
+- The CIO will be responsible for making policy regarding IT systems and their use within Mercy Ships.
+- The CIO will regularly communicate with the CEO, COO, Vice Presidents, National Office Directors, Ship CEOs, Ship COOs, Department Heads and Project Heads to ensure that their IT needs and business processes are well understood.  This extends to all operating locations including ships, national offices and land based programs.
+- The CIO will be primarily responsible for prioritizing IT projects with input solicited from the CEO, COO, VPs, National Office Directors, Ship CEOs, Ship COOs, Department and Project Heads across all locations.
+- The CIO will be responsible for interfacing with major donors or potential major donors when appropriate due to the donor�s involvement in the IT industry.
+- The CIO will be ultimately responsible for all efforts to secure donations of IT systems (software, hardware and outside resources)
+
+Qualifications (Knowledge, Skills, and Abilities): 
+To perform this job successfully, an individual must be able to perform each essential duty satisfactorily.  The requirements listed below are representative of the knowledge, skill and ability required.  Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+- Reasoning ability - This job requires the ability to define problems, collect data, establish facts and draw valid conclusions.  This job requires the ability to interpret an extensive variety of technical instructions in mathematical or diagram form and deal with problems involving several abstract and concrete variables.
+- Leadership demands - This job requires excellent leadership ability including skills in: relating to, communicating with, motivating and managing people.
+- Technical knowledge - The job requires significant technical knowledge of IT systems from desktop to infrastructure to enterprise.  The ability to quickly absorb new technical information is highly important. 
+- Language skills - This job requires the ability to read, analyze and interpret common scientific and technical journals, financial reports and legal documents.  This job requires the ability to respond to common inquiries or complaints from customers, regulatory agencies, or members of the business community.
+
+Education and Experience:
+This job requires the following:
+- University degree (BA/BS or equivalent)
+- 3 - 5 years experience in an IT related field
+The following items are not required for this job but would yield significant advantage:
+- Post graduate degree in an IT related or business field (MA/MS, MBA or equivalent)
+- 1 - 2 years field experience within Mercy Ships or other similar organization
+
+Work Environment:
+The work environment characteristics described here are representative of those an employee encounters while performing the essential functions of this job.  Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions:
+- The noise level in the work environment is usually quiet.
+- Travel, including international travel and travel to developing nations may be required.
+","Y"
+"IT102",31974,"IT01","The Chief Technology Officer (CTO) heads the group that identifies, develops and deploys IT systems.   In conjunction with the CIO, the CTO is responsible for researching and determining the IT strategy.  The CTO is responsible for managing all development and deployment projects and associated staff.","Essential Duties and Responsibilities (include but not limited to):
+- Consults with management to determine information requirements of departments, boundaries and priorities of new projects, and to discuss system abilities and capacity.
+- Confers with Department Heads involved with proposed projects to ensure their needs will be met by the project.
+- Consults with and manages System Analysts, Programmers, Database Administrators and other staff to support existing systems and schedule enhancements.
+- Prepares progress reports to inform management of project status and deviation from previously stated goals.
+- Assists CIO in prioritizing IT projects according to feedback from VPs, National Office Directors, Ships� Executive Staff and Department Heads.
+- Maintains a current knowledge of industry trends and new technologies, seeking to find applicable solutions for Mercy Ships.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+To perform this job successfully, an individual must be able to perform each essential duty satisfactorily.  The requirements listed below are representative of the knowledge, skill and ability required.  Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+- Reasoning ability - This job requires the ability to define problems, collect data, establish facts and draw valid conclusions.  This job requires the ability to interpret an extensive variety of technical instructions in mathematical or diagram form and deal with problems involving several abstract and concrete variables.
+- Leadership demands - This job requires excellent leadership ability including skills in: relating to, communicating with, motivating and managing people.
+- Technical knowledge - The job requires significant technical knowledge of IT systems from desktop to infrastructure to enterprise.  The ability to quickly absorb new technical information is highly important. 
+- Language skills - This job requires the ability to read, analyze and interpret common scientific and technical journals, financial reports and legal documents.  This job requires the ability to respond to common inquiries or complaints from customers, regulatory agencies, or members of the business community.
+
+Education and Experience:
+This job requires the following:
+- University degree (BA/BS) or equivalent work experience.
+- 5 - 10 years experience in an IT related field
+The following items are not required for this job but would yield significant advantage:
+- Post graduate degree in an IT related field (MA/MS)
+- 1 - 2 years experience within Mercy Ships or other similar organization
+
+Work Environment:
+The work environment characteristics described here are representative of those an employee encounters while performing the essential functions of this job.  Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions:
+- The noise level in the work environment is usually quiet.
+- Travel, including international travel and travel to developing nations may be required.","Y"
+"IT111",31975,"IT01","None","None","Y"
+"IT121",31976,"IT01","- Works with IT Department Staff to procure hardware, software and other materials to meet IT Department Needs.  Procurement includes seeking discounts and donations as well as purchasing when necessary.
+- Builds relationships with vendors and potential donors.
+- Gathers detailed information to specify project to aid in fund raising and grant writing.
+- Manages the asset replacement process to keep IT assets current in accordance with the replacement policy set by the CIO.
+- Maintains the IT vendor list.","REPORTS TO: Chief Information Officer 
+
+DESCRIPTION:
+- Works with IT Department Staff to procure hardware, software and other materials to meet IT Department Needs. Procurement includes seeking discounts and donations as well as purchasing when necessary.
+- Builds relationships with vendors and potential donors.
+- Gathers detailed information to specify project to aid in fund raising and grant writing.  
+- Manages the asset replacement process to keep IT assets current in accordance with the replacement policy set by the CIO.
+- Maintains the IT vendor list. 
+
+POSITION SCOPE:
+Procurement of:
+- Consumables
+- PC Components
+- PCs
+- Server Components
+- Servers
+- Network Components
+- Operational Needs
+- Funds for the above or general operations
+
+SOURCES OF TECHNICAL SUPPORT:
+- Independent Research (web, periodicals, publications, etc?)
+- IT Staff (System Administrator, Network Administrator, DB Administrator, Systems Engineer, PC Technician, CTO, CIO)
+- Vendor Sources (Help Desk, Engineers, Sales Support)
+
+SCOPE OF IMPACT:
+- Successful execution of this job will save Mercy Ships money, provide needed materials for Mercy Ships and ultimately make the organization more efficient and effective.
+- Unsuccessful execution of this job will mean that Mercy Ships does not capitalize on opportunities for increased efficiency and effectiveness.
+
+SUPERVISON AND DIRECTION:
+- General supervision is required to set priorities and assign/manage projects
+- Correspondence with outstide organizations should be reviewed by superior
+
+EDUCATION/WORK EXPERIENCE:
+- High School Diploma or equivalent or equivalent training and experience is need.
+
+SKILLS:
+This job requires:
+- Good people skills
+- Good writing/correspondance skills
+- Ability to understand computer components and their specifications
+- Project management skills
+- Analysis skills","Y"
+"IT131",31977,"IT01","None","None","Y"
+"IT141",31978,"IT01","None
+","None","Y"
+"IT109",31979,"BUSN","None
+","None","Y"
+"IT151",31986,"IT01","None
+","None","Y"
+"IT152",31987,"IT01","None
+","None","Y"
+"MS1002",33253,"SHIP","none
+","none",
+"EX1037",33259,"BUSN","none","none",
+"EX1038",33260,"BUSN","none","none","Y"
+"DN1000",33269,"MEDT","none
+","none","Y"
+"DN1001",33270,"MEDT","Assist chair-side in general dentistry. May also perform instrument sterilization procedures (autoclave, ultrasonic available).","none","Y"
+"DN1002",33271,"MEDT","none","none","Y"
+"DN1003",33272,"MEDT","Scaling (Cavitron available) and prophylaxis on adults and children. Group and individual oral hygiene instructions given. May also serve as a chair side dental assistant or to do instrument sterilization procedures (autoclave and ultrasonic available).","none","Y"
+"DN1004",33273,"MEDT","none","none","Y"
+"DN1005",33274,"MEDT","none","none","Y"
+"DN1006",33275,"MEDT","none","none","Y"
+"DN1007",33276,"MEDT","none","none","Y"
+"DN1008",33277,"MEDT","none","none","Y"
+"DN1009",33278,"MEDT","General dentistry (restorative, extractions, and maybe some light scaling) on adults and children. No specialty areas (i.e. endodontics, periodontics, oral surgery impactions, orthodontics, cosmetic dentistry, crown and bridge etc.) are performed due to too much time expended per patient, repeat visits needed, lab support lacking, or cost too great.","none","Y"
+"DN1010",33279,"MEDT","Provides dental procurement services and liaison with dental professionals for health care outreaches.","none","Y"
+"DN1011",33280,"MEDT","none","none","Y"
+"MD1000",33281,"BUSN","none","none","Y"
+"MD1001",33282,"MEDT","none","none","Y"
+"MD1002",33283,"MEDT","none","none","Y"
+"MD1003",33284,"MEDT","Oversee the maintenance and management of medical devices. Arrange for scheduled maintenance and calibration of equipment. Perform preventative maintenance and repair of medical equipment.","none","Y"
+"MD1004",33285,"MEDT","none","none","Y"
+"MD1005",33286,"MEDT","none","none","Y"
+"MD1006",33287,"MEDT","none","none","Y"
+"MD1007",33288,"MEDT","none","none","Y"
+"MD1008",33289,"MEDT","(Internal medicine, General practice, ER) Assist the CHT Medical Coordinator as needed in the day-to-day running of the team�s    activities. Provide consultation and treatment for patients in the Medical Clinic, referring patients to local health structures as needed.","none","Y"
+"MD1010",33291,"MEDT","none","none","Y"
+"MD1011",33292,"MEDT","none","none","Y"
+"MD1012",33293,"MEDT","none","none","Y"
+"MD1013",33294,"MEDT","none","none","Y"
+"MD1014",33295,"MEDT","none","none","Y"
+"MD1015",33296,"MEDT","Review, define, recommend and design optimal organizational methods, procedures and information systems for Mercy Ships HealthCare Services.  Supervise and participate in projects that accomplish these goals using current technology computers and related software tools.  Support projects for other departments will be considered on a priority/time available basis.  ","none","Y"
+"AG1006",32491,"RVDF","Provide hands on support working at various tasks with in the agriculture department. ","none","Y"
+"AG1007",32492,"RVDF","Assisting in various areas of the Farm and Agriculture Department.  (Vegetable garden appropriate technologies, various maintenance projects, special projects as assigned).  Helps maintain agriculture department buildings, facilities and equipment. ","none","Y"
+"AG1008",32493,"RVDF","Give leadership to and be responsible for the implementation of the Mercy Ships IOC Forest Stewardship Plan.
+","none","Y"
+"AG1009",32494,"RVDF","Provide hands on support working at various tasks with in the agriculture department. ","none","Y"
+"AG1010",32495,"RVDF","Assist the Greenhouse manager to grow,  raise and market healthy greenhouse plants in a sustainable and renewable way, implementing as many organic practices and methods as possible.  ","none","Y"
+"AG1011",32496,"RVDF","Grow, raise and market healthy greenhouse plants in a sustainable and renewable way, implementing as many organic practices and methods as possible.","none","Y"
+"AG1012",32497,"RVDF","Assist landscape horticulturist and grounds care supervisor in the planting, care and maintenance of the campus flower beds and landscaping. ","none","Y"
+"AG1013",32498,"RVDF","Manage and direct the operations of the Mercy Ships Training Center Greenhouse.  Grow, raise and market healthy greenhouse plants in a sustainable and renewable way, implementing as many organic practices and methods as possible.","none","Y"
+"AG1014",32499,"RVDF","To provide oversight, support and direction for the daily operations and activities of the Agriculture Training Center, its farm, and related components of the operations of the Agriculture department.","none","Y"
+"AG1015",32500,"RVDF","none
+","none","Y"
+"AG1016",32501,"RVDF","Provide leadership, hands on support and direction of Mercy Ships organic garden.  This includes planning the garden with the useful purpose  of  teaching and researching gardening methods environment applicable and readily duplicatable in developing nations as well as growing fresh produce for the IOC and local market outlets.  ","none","Y"
+"AG1017",32502,"RVDF","Provide hands on support in Mercy Ships organic garden.","none","Y"
+"AG1018",32503,"RVDF","none","none","Y"
+"AG1019",32504,"RVDF","none","none",
+"AG1020",32505,"RVDF","To provide oversight,  support and daily direction for the operations and activities of the Training Center Farm.","none","Y"
+"AG1021",32506,"RVDF","none","none","Y"
+"AG1022",32507,"RVDF","none","none","Y"
+"AG1023",32508,"RVDF","none","none","Y"
+"AG1024",32509,"RVDF","none
+","none","Y"
+"CH1000",32510,"BUSN","Schedules appointments, greets visitors to office, gives information to callers, takes dictation, and otherwise relieves officials of clerical work and minor administrative and business detail.","none","Y"
+"CH1001",32511,"PAST","Supports the Strategies, Goals, Vision and Purposes of Mercy Ships International Chaplain Ministry.  This role is primarily related to the staff of the location however, assignments may be given outside of the described group or geographic area.  This role primarily invests in the area of Pastoral Care.  ","none",
+"CH1002",32512,"PAST","none","none",
+"CH1003",32513,"PAST","This indidual works with the evanglism coordinator and would coordinate where applicable, efforts with the youth ministry coordinator to serve the children (many of them homeless) of leon and surrounding areas.  ","none","Y"
+"CH1004",32514,"PAST","none
+","none",
+"CH1005",32515,"PAST","none","none",
+"CH1006",32516,"PAST","none
+","none","Y"
+"CH1007",32517,"PAST","none","none","Y"
+"CM1000",32518,"COMM","none","none","Y"
+"CM1001",32519,"COMM","none","none","Y"
+"CM1002",32520,"COMM","none","none","Y"
+"CM1003",32521,"COMM","none","none","Y"
+"CM1005",32523,"COMM","none","none","Y"
+"CM1006",32524,"COMM","This person manages the communications staff, projects and activities at the IOC.  Responsibilities include Video, graphics and direct mail appeals.","none","Y"
+"CM1007",32525,"COMM","none","none","Y"
+"CM1008",32526,"COMM","none","none","Y"
+"CM1010",32528,"COMM","Oversee/manage the ongoing direct mail for Mercy Ships (North America and Europe).  Conduct marketing analysis of results of success of mail programs. ","none","Y"
+"CM1011",32529,"COMM","none","none","Y"
+"CM1012",32530,"COMM","In addition to the duties of writer, this person also is responsible for editing the written work of others fro grammar content and style.","none","Y"
+"CM1013",32531,"COMM","none","none","Y"
+"CM1014",32532,"COMM","Utilizing the creative skills of a graphic artist, this person will lay out advertisements, brochures, exhibits and other visual communications tools.","none","Y"
+"CM1017",32534,"COMM","none","none","Y"
+"CM1018",32538,"COMM","none
+","none","Y"
+"CM1019",32539,"COMM","none","none","Y"
+"CM1020",32540,"COMM","To promote awareness of Mercy Ships by coordinating the Mercy Minutes daily radio program.","Essential Duties And Responsibilities: include, but are not necessarily limited to the following: (Other duties may be assigned).
+*To do justly, to love kindness, and to walk humbly before God (Michah 6:8)
+*To effectively raise personal support, and report back to personal donor base.
+*To be responsible for all aspects of the Mercy Minutes daily radio program.
+*To ensure that a minimum of 65 quality scripts are written (half from Mercy Ships and half from outside of Mercy Ships) each quarter.
+*To edit all scripts read for recording.
+*To work with Ambassador Advertising on how to get more radio stations to air the Mercy Minute program, how to retain existing stations, etc. 
+*Once the quarterly has been made, to retype all edits to the scripts and send them on to the webmaster for posting to the website.
+*To seek out newspapers that will air the Mercy Minute as a daily column.
+*To find ways to create a revenue stream from the Mercy Minute program.
+*To communicate with other Mercy Ships offices to find ways to get the Mercy Minutes
+aired in as many markets and foreign languages as possible.","Y"
+"CM1021",32541,"COMM","Keep Glenn in line","none","Y"
+"CM1022",32542,"COMM","This person keeps and manages all Mercy Ships photographic images.  Duties include filing cataloging, printing and distributing pictures to Mercy Ships stake holders.","none","Y"
+"CM1023",32543,"COMM","none","none","Y"
+"CM1024",32544,"COMM","Manages all aspects of video production for Mercy Ships.
+
+
+
+
+
+
+
+","Essisential Duties And Responsibilities: include, but are not necessarily limited to the following: (Oher duties may be assigned).
+*To do justly, to love kindness, and to walk humbly before God. (Micah 6:8).
+*To effectively raise personal support, and report back to personal donor base.
+*To ensure that all video productions match in style and content with the overall goals and missions statement of Mercy Ships. 
+*To produce all videos presentations such as ship history, outreaches, television presentations, training vidoes, special projects as requested.
+*Develop relationships with television stations for airing programs and special video presentations, and to supply TV stations, etc. with requested B-roll footage.
+*To maintain video archive library and supply fulfillment and the General store with duplicate taps required.
+*To maintain video and technial equipment, and order replacement equipment as needed.
+*To travel to the field to shoot vido and conduct interviews as needed.
+*To archive and log vido footage for quick access to future needs.","Y"
+"CM1025",32545,"COMM","none","none","Y"
+"CM1027",32547,"COMM","none","none","Y"
+"CM1028",32548,"COMM","none","none","Y"
+"CM1029",32549,"COMM","none","none","Y"
+"CM1032",32551,"COMM","none","none","Y"
+"CM1033",32552,"COMM","none","none","Y"
+"CM1034",32553,"COMM","none
+","none","Y"
+"CM1035",32554,"COMM","This person manages the video production activities fro Mercy Ships, including camera work, editing, computer mixing and production.  Other duties includes copy productions and file keeping.","none","Y"
+"CM1036",32555,"COMM","none","none","Y"
+"CM1037",32556,"COMM","none","none","Y"
+"CM1038",32557,"COMM","This person writes copy for the Mercy Minute, Daily Compass, newsletter and other publications as needed.","none","Y"
+"CC1000",32559,"HOST","none
+","none","Y"
+"CC1001",32560,"HOST","Manages activities","none","Y"
+"CC1003",32561,"HOST","none","none","Y"
+"CC1004",32562,"FOOD","none
+","none","Y"
+"CC1005",32563,"FOOD","none","none","Y"
+"CC1006",32564,"HOST","none","none","Y"
+"CC1007",32565,"MANT","none","none","Y"
+"CC1008",32566,"WARE","none","none","Y"
+"CC1009",32567,"WARE","none","none","Y"
+"CC1010",32568,"WARE","none","none","Y"
+"CC1011",32569,"FOOD","none","none","Y"
+"CC1012",32570,"FOOD","none","none","Y"
+"CC1013",32571,"FOOD","none","none","Y"
+"CC1014",32572,"HOST","none","none","Y"
+"CC1015",32573,"HOST","none","none","Y"
+"CC1016",32574,"FOOD","none","none","Y"
+"CC1017",32575,"FOOD","none","none","Y"
+"CC1018",32576,"FOOD"," Handles all office procedures, monies, and work time charts.
+
+","?	Records Capstone hours for any paid employees.
+?	Responsible for monies collected for meals and delivering cash to Accounting dept.
+?	Schedules department work hours for all community meals.
+?	Corresponds with  departments about supplies needs.
+?	Responsible for keeping calendar of events for dining room.
+?	Responsible for administering the Meal Ticket Voucher Program, including arranging ticket checking weekday lunchtimes, supplying meal tickets and vouchers to receptionists, counting tickets and cash weekly, providing use statistics to Campus Services Director, recycling tickets, providing updated information on the program to Hospitality, Training and Education (for schools), and base residents. 
+
+Qualifications (Knowledge, Skills, and Abilities): 
+The employee should have some basic math skills, be able to type and have some basic computer skills. They should also have good communication skills and the ability to deal with staff at all levels.  
+
+Education and Experience:
+Recommended to have successfully completed a DTS/Crossroads. Must meet requirements set by the Dining Room Department. They should have a high school diploma or its equivalent.
+
+Work Environment:
+The employee must be able to sit and work on a computer many hours.  Be willing to step in and help the other employees 
+if there is a need.  Be able to get around to the other building to send faxes and deliver meal tickets, vouchers and monies to the correct places.
+
+
+
+
+","Y"
+"CC1019",32577,"FOOD","none","none","Y"
+"CC1020",32578,"FOOD","none","none","Y"
+"CC1021",32579,"HOST","none","none","Y"
+"CC1022",32580,"BUSN","none","none","Y"
+"CC1023",32581,"FOOD","none","none","Y"
+"CC1024",32583,"HOST","none","none","Y"
+"CC1026",32585,"FOOD","none","none","Y"
+"CC1027",32586,"FOOD","none","none","Y"
+"CC1028",32587,"FOOD","none","none","Y"
+"CC1029",32588,"FOOD","none","none","Y"
+"CC1030",32589,"FOOD","none","none","Y"
+"CC1031",32590,"FOOD","none","none","Y"
+"CC1032",32591,"HOST","none","none","Y"
+"CC1033",32592,"HOST","none","none","Y"
+"CC1034",32593,"HOST","none","none","Y"
+"CC1035",32594,"HOST","none","none","Y"
+"CC1036",32595,"HOST","none","none","Y"
+"CC1037",32596,"HOST","none","none","Y"
+"CC1038",32597,"HOST","none","none","Y"
+"CC1039",32598,"HOST","none","none","Y"
+"CC1040",32599,"HOST","none","none","Y"
+"CC1041",32600,"HOST","none","none","Y"
+"CC1042",32601,"FOOD","none","none","Y"
+"CC1043",32602,"HOST","none","none","Y"
+"CC1044",32603,"WARE","none","none","Y"
+"CC1045",32604,"HOST","none
+","none","Y"
+"CC1046",32605,"BUSN","none
+
+
+","none","Y"
+"CC1047",32606,"FOOD","none","none","Y"
+"CC1048",32607,"HOST","none","none","Y"
+"CC1049",32608,"FOOD","none","none","Y"
+"CC1050",32609,"FOOD","none","none","Y"
+"CC1051",32610,"FOOD","none","none","Y"
+"CC1052",32611,"FOOD","none","none","Y"
+"CC1053",32612,"FOOD","none","none","Y"
+"CC1054",32613,"WARE","none","none","Y"
+"CC1055",32614,"WARE","none","none","Y"
+"CC1056",32615,"WARE","none","none","Y"
+"MD1016",33297,"MEDT","Provide support to the Health Care Teams during the assessment, planning, implementation and reporting stages.  Assist with Community Health Education Evangelism.","none","Y"
+"MD1017",33298,"MEDT","Coordinates Health Care teams for Mercy Teams in locations targeted by Mercy Ships including preparation, follow-up and management of the team logistics when operational. Maintains records of the outreach statistics for management of resources.","none","Y"
+"MD1018",33299,"MEDT","Coordinates Health Care teams for Mercy Teams in locations targeted by Mercy Ships including preparation, follow-up and management of the team logistics when operational. Maintains records of the outreach statistics for management of resources.","none","Y"
+"MD1019",33300,"MEDT","none","none","Y"
+"MD1022",33301,"MEDT","none","none","Y"
+"MD1023",33302,"MEDT","To assist in fulfilling the overall vision of Mercy Ships through acquisition of donated medical supplies and equipment for the ships.","none","Y"
+"MD1024",33303,"MEDT","none","none","Y"
+"MD1025",33304,"MEDT","none","none","Y"
+"MD1027",33306,"MEDT","none","none","Y"
+"MD1028",33307,"MEDT","none","none","Y"
+"MD1029",33308,"MEDT","Provide public relations support to Health Care Services special events, missions conferences, and special projects including writing for video projects and grants, organizing open houses, fund-raisers.","none","Y"
+"DS1000",32652,"BUSN","none","none",
+"DS1001",32653,"BUSN","none","none",
+"DS1002",32654,"BUSN","none","none","Y"
+"DS1003",32655,"BUSN","none","none","Y"
+"DS1004",32656,"BUSN","none","none","Y"
+"DS1005",32657,"BUSN","none
+","none","Y"
+"ED1000",32658,"BUSN","none","none","Y"
+"ED1001",32659,"EDUC","none","none","Y"
+"ED1002",32660,"EDUC","none","none","Y"
+"ED1003",32661,"EDUC","none","none","Y"
+"ED1004",32662,"EDUC","none
+","none","Y"
+"ED1005",32663,"EDUC","Work with new and incoming participants aiding in the application process and working with other staff to ensure smooth transition from applicant to participant.
+","?	Attends staff meetings on a regular basis
+?	Attends training sessions as needed to perform the job
+?	Participates in outreach planning and/or leads a group on the actual outreach as requested by your supervisor
+?	Processes all incoming and outgoing mail
+?	Maintains accurate records of all participants and keeps HR tracking and Partnership current and up to date
+?	Routes all applications to school leadership for approval
+?	Maintains personal contacts with applicants in order to ensure a timely application process and provide for a smooth transition to the Mercy Ships base
+?	Delegates responsibilities to assigned staff as needed and provides clear instruction
+?	Assembles an agenda for weekly staff meetings by getting input from all staff and keeps records of those meetings
+?	Prepares a calendar for each school which includes the daily schedule, social activities, and birthdays
+?	Prepares a calendar for the staff and communicates regularly to staff any changes in schedule, announcements, etc on a weekly basis or as needed
+?	Notify department heads as needed to communicate when the participants are arriving, their schedule, names, etc. at least 2 weeks prior to the beginning of the school
+?	Serves as the kitchen liason to keep them informed of activities which will affect their department and order supplies as needed
+?	Communictes on an ongoing basis with hospitality regarding student housing needs, speaker housing needs, etc.
+?	Maintains a procedure manual with current forms, procedures, etc. to be used as a resource for all staff
+?	Maintains an inventory of office supplies and orders as needed within the current budget 
+?	Serves as the communication point for staff, participants, and other departments.  Delegates to other staff the responsibility of making  announcements to be given during a normal school day.
+?	Prepares welcome manuals for participants 
+?	Prepares manuals for staff prior to the beginning of each school 
+?	Submits purchase orders for approval and communicates with accounting regarding the payment of speaker fees, etc. to be done in a timely manner
+?	Assists with orientation of new staff and helps them as needed to be welcomed into the Mercy Ships organization
+?	Functions as an administrative assistant as needed for the Crossroads Director of Training, School Director, and other staff
+","Y"
+"ED1006",32664,"EDUC","Involved in the preparation process of programs, hand-on leadership of various activities throughout the course of the program, including small group leadership.","none","Y"
+"ED1007",32665,"EDUC","none","none","Y"
+"ED1008",32666,"BUSN","none","none","Y"
+"ED1009",32667,"EDUC","none","none","Y"
+"ED1010",32668,"EDUC","none","none","Y"
+"ED1011",32669,"EDUC","none","none","Y"
+"ED1012",32670,"EDUC","Oversight of Gateway staff, curriculum, with hands-on involvement in lecture and outreach protions of program.","none","Y"
+"ED1013",32671,"EDUC","none","none","Y"
+"ED1014",32672,"EDUC","none","none","Y"
+"ED1015",32673,"EDUC","none","none","Y"
+"ED1016",32674,"EDUC","To support the Medical Education Facilitator in developing and organising courses, including liaison with speakers and participants and making practical arrangements for courses.","Essential Duties and Responsibilities (include but not limited to):
+* Assisting the Medical Education Facilitator in developing courses and educational materials.
+* Answering inquiries about medical education programs, sending out information and application packets; liaison with participants before, during and after courses
+* Registering participants for courses, sending out acceptance packets, setting up participant files, entering on Partnership; liaison with Accounting for payment of course fees 
+* Booking selected speakers for courses; liaison regarding schedules, content, handsouts, post-course evaluations, travel arrangements, honoraria, book lists for General Store
+* Arranging advertising for courses in suggested media and via mailings
+* Preparation of course handbook for each participant and course completion certificates; provision and collation of daily attendance sheets; collation of pre- and post-tests, daily evaluation sheets, course evaluations
+* With Education department Hospitality coordinator, arranging accommodation, meals and snacks for course participants and speakers, welcome baskets, name badges, meal cards, graduation dinner, gifts for speakers and worship leaders, classroom set-up clean-up
+* With Education department Transport coordinator, organizing airport runs for speakers and participants, booking base vehicles
+* Ordering office supplies and other requisites
+* Other appropriate duties and responsiilities as assigned by the reporting manager","Y"
+"ED1017",32675,"EDUC","none","none","Y"
+"ED1018",32676,"BUSN","none","none","Y"
+"ED1019",32677,"EDUC","none","none","Y"
+"ED1020",32678,"EDUC","none","none","Y"
+"ED1021",32679,"EDUC","none","none","Y"
+"ED1022",32680,"EDUC","none","none","Y"
+"ED1023",32681,"EDUC","none","none","Y"
+"ED1024",32682,"EDUC","none","none","Y"
+"EX1000",32707,"BUSN","none","none","Y"
+"EX1001",32708,"BUSN","none","none","Y"
+"EX1003",32710,"BUSN","none","none",
+"EX1006",32712,"BUSN","none","none",
+"EX1007",32713,"BUSN","none
+","none","Y"
+"EX1008",32714,"BUSN","none","none",
+"EX1009",32715,"BUSN","none","none","Y"
+"EX1010",32716,"BUSN","none","none",
+"EX1011",32717,"BUSN","none","none","Y"
+"EX1013",32718,"BUSN","none","none",
+"EX1014",32719,"PAST","none","none",
+"EX1016",32721,"BUSN","none","none",
+"EX1019",32722,"BUSN","none","none",
+"EX1020",32723,"BUSN","none","none",
+"EX1021",32724,"BUSN","none","none",
+"EX1022",32725,"BUSN","none","none","Y"
+"EX1023",32726,"BUSN","none","none","Y"
+"EX1024",32727,"BUSN","none","none","Y"
+"EX1025",32728,"BUSN","none","none","Y"
+"EX1028",32731,"BUSN","none","none",
+"EX1029",32732,"BUSN","none","none","Y"
+"EX1030",32733,"BUSN","none","none","Y"
+"EX1031",32734,"BUSN","none","none","Y"
+"EX1032",32735,"BUSN","none","none","Y"
+"EX1033",32736,"BUSN","none","none","Y"
+"EX1036",32737,"BUSN","none","none",
+"FM1000",32738,"MANT","Completes non-complex jobs to preserve physical appearance of lawns by mowing, raking, planting, fertilizing, or watering. Uses mowers, rakes, or other hand and power tools typically used in gardening, as directed by the Foreman Lawn Maintenance. ","none","Y"
+"FM1001",32739,"MANT","none","none","Y"
+"FM1002",32740,"MANT","none","none","Y"
+"FM1003",32741,"MANT","Constructs, repairs, alter, and maintains offices, buildings, fixtures, or furniture by performing rough or finish carpentry work. Provides assistance with facility major construction plans. Journey level. ","none","Y"
+"FM1004",32742,"MANT","Completes non-complex jobs to maintain or repair offices, buildings, fixtures, or furniture. May perform physical work to assist carpenter in construction projects, as directed by the carpenter.","none","Y"
+"FM1005",32743,"MANT","Responsible for coordinating services, tasks and personnel for planning, design, and management of renovations/new construction projects in compliance with federal, state and local mandated regulations, under the direction of the Director. ","none","Y"
+"FM1006",32744,"MANT","Directs all facility, grounds, water and wastewater treatment, equipment and vehicle maintenance at the International Operations Center (IOC). Directs all construction projects, such as new construction, renovations and relocation of equipment. Prepares annual department budgets and budgets for major projects. Participates in the master planning process for the IOC. ","none","Y"
+"FM1007",32745,"MANT","Installs, repairs, or maintains electric energy equipment by performing electrical work at a journey level. Assignments include installing and repairing wiring, equipment, fixtures, or other electrical devices. Performs diagnosis and maintenance work on equipment.","none","Y"
+"FM1008",32746,"MANT","Completes non-complex jobs to maintain or repair electric energy equipment. May perform physical work to assist electrician in installation, repair and maintenance projects, as directed by the electrician.","none","Y"
+"FM1009",32747,"BUSN","Provides administrative support to the Director (and, as time and priorities allow, to the department�s managers) to maintain documentation and to assist in the management of daily departmental operations, including coordinating meetings and work schedules, answering telephones, drafting correspondence, filing and photocopying. ","none","Y"
+"FM1011",32748,"MANT","Provides work direction and supervision for garden bed maintenance workers. Preserves physical appearance of grounds by planting, fertilizing, trimming, or watering and performs supplementary landscape maintenance. Uses rakes or other hand and power tools typically used in gardening.","none","Y"
+"FM1012",32749,"MANT","Provides work direction and supervision for lawn maintenance workers. Preserves physical appearance of lawns by mowing, raking, planting, fertilizing, or watering and performs supplementary landscape maintenance. Uses mowers, rakes, or other hand and power tools typically used in gardening.","none","Y"
+"FM1013",32750,"MANT","Provides work direction and supervision for tradesmen involved in maintenance and repair work of facilities and equipment. Looks over work requests to decide problem and resolution, and delegates assignments. ","none","Y"
+"FM1014",32751,"MANT","Provides work direction and supervision for tree maintenance workers. Maintains the health and aesthetics of trees and other shrubbery and performs supplementary landscape maintenance. Operates, repairs, and maintains specialized tree maintenance equipment. ","none","Y"
+"FM1015",32752,"MANT","Completes non-complex jobs to preserve physical appearance of lawns by mowing, raking, planting, fertilizing, or watering. Uses mowers, rakes, or other hand and power tools typically used in gardening, as directed by the Foreman Garden Bed Maintenance.","none","Y"
+"FM1016",32753,"MANT","Plans and implements grounds maintenance and improvement programs and develops programs to reduce operating costs. Provides work direction and supervision for tradesmen involved in maintenance and development work on grounds. Looks over work requests to decide problem and resolution, and delegates assignments. ","none","Y"
+"FM1017",32754,"MANT","Works under the supervision of the HVAC Specialist to develop the necessary skills to help in the construction and installation of heating, ventilation, and air conditioning systems. May perform physical work to assist in projects, as directed by the HVAC Specialist.","none","Y"
+"FM1018",32755,"MANT","Completes non-complex jobs to install, maintain, and repair heating, ventilation, and air conditioning systems. May perform physical work to assist in projects, as directed by the HVAC Specialist.","none","Y"
+"FM1019",32756,"MANT","Installs, maintains, and repairs heating, ventilation, and air conditioning systems. Includes inspection of piping, valves, electrical wiring and other related equipment.","none","Y"
+"FM1020",32757,"MANT","none","none","Y"
+"FM1021",32758,"MANT","Directs work involved in operating and maintaining heating, cooling, or ventilation equipment. Formulates and arranges plans to update systems or reduce operating costs. Analyzes and solves technical maintenance problems. Assures security and fire alarm systems kept in good working order.","none","Y"
+"FM1022",32759,"MANT","Plans, organizes and manages transportation vehicles to provide maintenance and repair of the vehicles, ensuring proper operation and availability of vehicles for use by departments.","none","Y"
+"FM1023",32760,"MANT","Performs maintenance or repair service for transportation vehicles, including cars, minivans, or light trucks. Does not include heavy equipment. Takes apart and restores to working order mechanical or electrical devices such as clutches, starters, transmissions, or engines. Operates customary hand or power tools used for automotive repair.","none","Y"
+"FM1024",32761,"MANT","Maintains and repairs physical appearance of offices, buildings, fixtures, or furniture by hand brush, spray or roll painting and preparing surfaces prior to painting.","none","Y"
+"FM1025",32762,"MANT","Completes non-complex jobs to maintain and repair physical appearance of offices, buildings, fixtures, or furniture by hand brush, spray or roll painting and preparing surfaces prior to painting. May perform physical work to assist painter in projects, as directed by the painter. ","none","Y"
+"FM1026",32763,"MANT","Makes trips to local suppliers for parts delivery and pick up. ","none","Y"
+"FM1027",32764,"MANT","Installs, maintains, and repairs all types of plumbing systems and fixtures. Uses plans, blueprints, and drawings. Designs layout and plans pipe assemblies according to recognized pipefitting practices. ","none","Y"
+"FM1028",32765,"MANT","Completes non-complex jobs to install, maintain, and repair all types of plumbing systems and fixtures. May perform physical work to assist plumber in construction projects, as directed by the plumber.","none","Y"
+"FM1029",32766,"MANT","none","none","Y"
+"FM1030",32767,"MANT","none","none","Y"
+"FM1031",32768,"MANT","Provides work direction and supervision for tradesmen involved in maintenance and repair work on vehicles. Looks over work requests to decide problem and resolution, and delegates assignments. ","none","Y"
+"FM1032",32769,"MANT","Performs routine duties in the care and treatment of trees and shrubs. Operates and maintains equipment and tools associated with tree care and removal. ","none","Y"
+"FM1033",32770,"MANT","Controls treatment plant machines and equipment to purify and clarify water for human consumption and for industrial use.","none","Y"
+"FM1034",32771,"MANT","Uses a variety of torch and/or electric arc-welding processes, welds a variety of metals and their alloys in the fabrication and repair of metal structures, equipment and items. ","none","Y"
+"FM1035",32772,"MANT","Completes non-complex jobs to assist with a variety of torch and/or electric arc-welding processes, welding a variety of metals and their alloys in the fabrication and repair of metal structures, equipment and items. May perform physical work to assist welder in construction projects, as directed by the welder. ","none","Y"
+"FA1000",32777,"BUSN","none","none","Y"
+"FA1001",32778,"BUSN","none","none","Y"
+"FA1002",32779,"BUSN","none","none","Y"
+"FA1003",32780,"BUSN","none","none","Y"
+"FA1004",32781,"BUSN","none","none","Y"
+"FA1005",32782,"BUSN","none","none","Y"
+"FA1006",32783,"BUSN","none","none","Y"
+"FA1008",32784,"BUSN","none","none","Y"
+"FA1009",32785,"BUSN","none","none","Y"
+"FA1010",32786,"BUSN","none","none","Y"
+"FA1011",32787,"BUSN","none","none","Y"
+"FA1012",32788,"BUSN","Maintain ship bank for the crew, students and volunteers using the Geneva program.  Includes serving the crew with their transactions and inquiries.","none","Y"
+"FA1013",32789,"BUSN","Distribute and reconcile Accounting Advance and Payment Vouchers (AVs & PVs).  Issue payable checks as directed.  Prepare daily, weekly, monthly, and annual reconciliation reports for Accounting.","none","Y"
+"FA1014",32790,"BUSN","Pastoral responsibilities for the Finance Department crew members, ensuring that the core characteristics are understood and modeled.  Account for financial decisions made by the Assistant CEO and any delegated authority for expenses to department heads.","none","Y"
+"FA1015",32791,"BUSN","none","none","Y"
+"FA1016",32792,"BUSN","none","none","Y"
+"FA1017",32793,"BUSN","none","none","Y"
+"FA1018",32794,"BUSN","none","none","Y"
+"FA1019",32795,"BUSN","none","none","Y"
+"FA1020",32796,"BUSN","none","none","Y"
+"FA1021",32797,"BUSN","none","none","Y"
+"FA1022",32798,"BUSN","none","none","Y"
+"FA1023",32799,"BUSN","none","none","Y"
+"FL1000",32800,"BUSN","none","none","Y"
+"FL1001",32801,"BUSN","none","none","Y"
+"FL1002",32802,"BUSN","none","none","Y"
+"FL1004",32803,"BUSN","none","none","Y"
+"HR1000",32804,"PAST","none","none","Y"
+"HR1001",32805,"PAST","none","none","Y"
+"HR1002",32806,"BUSN","none","none","Y"
+"HR1003",32807,"BUSN","none","none","Y"
+"HR1004",32808,"BUSN","none","none","Y"
+"HR1005",32809,"BUSN","none","none",
+"HR1006",32810,"BUSN","none","none","Y"
+"HR1007",32811,"BUSN","none","none","Y"
+"HR1008",32812,"BUSN","none","none","Y"
+"HR1009",32813,"BUSN","none","none","Y"
+"HR1011",32815,"BUSN","none","none","Y"
+"HR1012",32816,"BUSN","none","none","Y"
+"HR1013",32817,"BUSN","none","none","Y"
+"HR1014",32818,"BUSN","none","none","Y"
+"HR1015",32819,"BUSN","none","none","Y"
+"HR1016",32820,"BUSN","none","none","Y"
+"HR1017",32821,"BUSN","none","none","Y"
+"HR1018",32822,"BUSN","none","none","Y"
+"IP1000",32824,"PAST","To support the organization through prayer, through organized prayer meetings and indivdual prayer times.","none","Y"
+"RC1000",32825,"BUSN","none
+","none","Y"
+"RC1001",32826,"BUSN","none","none","Y"
+"RC1002",32827,"BUSN","none","none","Y"
+"RC1003",32828,"BUSN","none","none","Y"
+"RC1004",32829,"BUSN","none","none","Y"
+"RC1005",32830,"BUSN","none","none","Y"
+"MS1000",32831,"SHIP","Amos Manager","none","Y"
+"MS1001",32832,"SHIP","none","none","Y"
+"MS1003",32833,"BUSN","none","none","Y"
+"MS1004",32834,"BUSN","none","none","Y"
+"MS1005",32835,"SHIP","Provides Computer Aided Drafting (CAD) services to support documentation of ship's structure and equirpment and planned changes.
+ 
+
+
+","Receives assignments from Project Engineer, Design Projects Manager, or other Marine Operations staff for purpose of new or revised drawings, analysis, determinations of accuracy, measurements, computations, and/or recommendations.
+Reviews assignments for clarity and confers with Project Engineer to resolve discrepancies.
+Advises Project Engineer on means to express in drawing format, the ideas the Project Engineer desires to commit to the drawing.
+Prepares drawings using a CAD program in accordance with standard drawing practices.
+Provides completed drawings or analyses to Project Engineer for review and approval.
+Occasionally prepares CAD drawings for other IOC Departments.
+","Y"
+"MS1006",32836,"SHIP","none","none","Y"
+"MS1007",32837,"SHIP","none","none","Y"
+"MS1008",32838,"SHIP","none","none","Y"
+"MS1009",32839,"SHIP","none","none","Y"
+"MS1010",32840,"SHIP","none","none","Y"
+"MS1011",32841,"BUSN","The Office Administrator is responsible for the smooth running of the office, answering the phone and relieving the technical staff of clerical work and administrative duties.","Distributes incoming mail.  Where needed, locates and attaches the appropriate file to correspondence to be answered by appropriate person. (VP Marine Ops., Engineering Supt., Safety Manager, etc.)
+
+Answers the telephone and gives information to callers or routes calls to appropriate staff.
+
+Greets visitors, ascertains nature of business and conducts visitors to appropriate persons.
+
+Composes and types routine correspondence.
+
+Files correspondence and other records.
+
+Orders office supplies and maintenance of office equipment as needed, liaising with Purchasing Agents.
+
+Records minutes of meetings where necessary.
+
+Compiles and types statistical reports as required.
+
+Assist in making travel bookings for departmental staff or fleet mariners as required, liaising with Purchasing Agents and/or corporate travel agent.
+
+Assist in organizing departmental social functions and calendar of activities.
+
+Other tasks as assigned and agreed by the Safety Manager or VP Marine Operations.
+QUALIFICATIONS (KNOWLEDGE, SKILLS, AND ABILITIES):
+To perform this job successfully, an individual must be able to perform each essential duty satisfactorily. The requirements listed below are representative of the knowledge, skill, and/or ability required. Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+
+Proficiency with computer applications, such as word processing, spreadsheet, and database programs.
+
+
+","Y"
+"MS1012",32842,"SHIP","none","none","Y"
+"MS1013",32843,"SHIP","none","none","Y"
+"MS1014",32844,"BUSN","none","none","Y"
+"MS1015",32845,"SHIP","none","none","Y"
+"MS1016",32846,"SHIP","none","none","Y"
+"MS1017",32847,"SHIP","none","none","Y"
+"MS1018",32848,"SHIP","none","none","Y"
+"MI1000",32849,"BUSN","People in this role will travel periodically, and meet teams on location and office locations.  This is an area that has to do with the actual outreach when teams join our ships for a week or two.","none","Y"
+"MI1001",32850,"BLDG","This person would facilitate team projects that are disaster relief in nature, but that we would work to integrate with existing ship programs at the outreach location.  The goal is to give church teams a start to finish project that will truly impact the area they will be working in.","none","Y"
+"MI1002",32851,"BUSN","Register and communicate with teams.  Accompany to field.","none","Y"
+"MI1003",32852,"BLDG","Oversee on site construction, recruit potential teams, plan building designs, arrange for architectual plans","none","Y"
+"MI1004",32853,"BUSN","Recruit and coordinate European Church teams, use knowledge of language and cultures to connect with current inquires as well as any personal contacts, establish good communication with european offices, provide resources, graphics, etc to european offices.","none","Y"
+"MI1005",32854,"BUSN","none","none","Y"
+"MI1006",32855,"BUSN","none","none","Y"
+"MI1007",32856,"BUSN","When teams are identified as having interest, the registrar is the first contact with the team.  A file is begun and the church contact is directed to appropriate staff member.  Also the registrar answers initial questions and creates interest in new contacts for the mission challenge.","none","Y"
+"MI1008",32857,"BUSN","Internet applications, mailings, contacts potential groups by phone, contacts Christian Universities, Advance work.","none","Y"
+"OD1000",32858,"BUSN","none","none","Y"
+"OT1000",32859,"BLDG","none
+","none","Y"
+"OT1001",32860,"PAST","none","none","Y"
+"OT1002",32861,"PAST","none","none","Y"
+"OT1003",32862,"PAST","Preforms a varity of tasks, tending to the spiritual needs of the people.  ","none","Y"
+"OT1004",32863,"PAST","Communicate to the crew about opportunities for crew evangelism.  Quality control of short testimonies, dramas and other tools needed for evangelism.  Keep records of each program, including number of people at the event, number of conversions, and a small account of the event with highlights.","none","Y"
+"OT1005",32864,"PAST","Perform at open airs, churches, prisons, schools, clinics, project sites, receptions and alongside the ship during tours while on PR tours. (Includes late hours and weekends).","none","Y"
+"OT1006",32865,"PAST","Perform at open airs, churches, prisons, schools, clinics, project sites, receptions and alongside the ship during tours while on PR tours. (Includes late hours and weekends).","none","Y"
+"OT1007",32866,"BUSN","none","none","Y"
+"OT1008",32867,"PAST","none","none","Y"
+"OT1009",32868,"BUSN","none","none","Y"
+"OT1010",32869,"PAST","none","none","Y"
+"OT1011",32870,"BUSN","none","none","Y"
+"OT1012",32871,"RVDF","Provides translation for ships and Health Care teams.  Able to fluently communicate in language of port country and has good people skills.","none","Y"
+"OT1014",32873,"RVDF","none","none","Y"
+"PA1000",32874,"BUSN","Coordinate the technical aspects of bringing the Ship into designated ports.","none","Y"
+"PA1001",32875,"BUSN","none","none","Y"
+"PA1002",32876,"BUSN","Go to Port City 12 - 16 weeks before one of our vessels ports there.  Team members have varying responsiblities includeing but not limited to Public Relations.","none","Y"
+"PA1003",32877,"BUSN","Coordinates Advance Teams and provides necessary training before they go to port cities.","none","Y"
+"PR1000",32878,"BUSN","none","none","Y"
+"PR1001",32879,"BUSN","none","none","Y"
+"PR1002",32880,"BUSN","none","none","Y"
+"RT1000",32881,"BUSN","none","none","Y"
+"RT1001",32882,"BUSN","none","none","Y"
+"RT1002",32883,"BUSN","none","none","Y"
+"RT1003",32884,"BUSN","none","none","Y"
+"RT1004",32885,"BUSN","none","none","Y"
+"RT1005",32886,"BUSN","none","none","Y"
+"RD1000",32887,"BUSN","none","none","Y"
+"RD1001",32888,"RVDF","none","none","Y"
+"RD1002",32889,"RVDF","none","none","Y"
+"RD1003",32890,"BLDG","none","none","Y"
+"RD1004",32891,"BLDG","none","none","Y"
+"RD1005",32892,"BLDG","none","none","Y"
+"RD1006",32893,"RVDF","none","none","Y"
+"RD1008",32894,"RVDF","none","none","Y"
+"RD1009",32895,"RVDF","none","none","Y"
+"RD1011",32896,"RVDF","none","none","Y"
+"RD1013",32898,"RVDF","none","none","Y"
+"RD1014",32899,"RVDF","none","none","Y"
+"RD1015",32900,"RVDF","none","none","Y"
+"RD1016",32901,"RVDF","none","none","Y"
+"RD1017",32902,"RVDF","none","none","Y"
+"RD1018",32903,"RVDF","none","none","Y"
+"RD1021",32904,"RVDF","none","none","Y"
+"RD1022",32905,"RVDF","none","none","Y"
+"RD1023",32906,"RVDF","none","none","Y"
+"RD1025",32907,"RVDF","none","none","Y"
+"RD1026",32908,"RVDF","none","none","Y"
+"RS1000",32909,"BUSN","none","none","Y"
+"RS1001",32910,"BUSN","To raise funds for the ministry of Mercy Ships - both general funds and special projects, in the identified region or state.  They should maintain a manageable caseload of donors and be able to make at least ten points of contact (personal visits, phone calls, correspondence, etc.) with each donor in a year.","none","Y"
+"RS1002",32911,"BUSN","To serve ministry donors by developing relationships with existing and new donors , which are identified by geographic regions or states.  Each Development Officer shall maintain a caseload of donors and be able to make at least ten points of contact (personal visits, phone calls, correspondence, etc.) with each donor in a year.","none","Y"
+"RS1003",32912,"BUSN","This role is integral to the achievement of the Organizations goal which is to raise at least $20 million in cash gifts per year in each of the years 2002, 2003, and 2004.   This should enable Mercy Ships to achieve its stated objective of serving one million people a year by the year 2005.","none","Y"
+"RS1004",32913,"BUSN","none","none","Y"
+"RS1005",32914,"BUSN","To raise funds for the ministry of Mercy Ships - both general funds and special projects, in the identified region or state.  They should maintain a manageable caseload of donors and be able to make at least ten points of contact (personal visits, phone calls, correspondence, etc.) with each donor in a year.","none","Y"
+"RS1006",32915,"BUSN","none","none","Y"
+"RS1007",32916,"BUSN","none","none","Y"
+"RS1008",32917,"BUSN","To raise funds for the ministry of Mercy Ships - both general funds and special projects, in the identified region or state.  They should maintain a manageable caseload of donors and be able to make at least ten points of contact (personal visits, phone calls, correspondence, etc. ) with each donor in a year.","none","Y"
+"RS1009",32918,"BUSN","To provide assistance to the Director of Resource Development in the functions of that department.  This would also include assisting Field Rep=s with travel arrangements, lodging, etc.","none","Y"
+"RS1010",32919,"BUSN","none","none","Y"
+"RS1012",32920,"BUSN","none","none","Y"
+"RS1013",32921,"BUSN","none","none","Y"
+"RS1014",32922,"BUSN","none","none","Y"
+"RS1015",32923,"BUSN","none","none","Y"
+"RS1016",32924,"BUSN","none","none","Y"
+"RS1018",32925,"BUSN","none","none","Y"
+"RS1019",32926,"BUSN","Coordinating vision trips to our bases and ships for major donors.","Essential Duties and Responsibilities (include but not limited to):
+�	Assist in organizing vision trips to each of the ships.
+�	Prepare informative materials for the vision trip guests.
+�	Work with office manager maintaining the department�s ink-jet printer.
+�	Coordinate airline and hotel reservations for our guests with Mission Travel.
+�	Keep in touch with immigration for visa requirements and changes.
+�	Assist in organizing special events (art auctions, desserts) as assigned.
+�	Help coordinate guest visits to the International Operations Center.
+Qualifications (Knowledge, Skills, and Abilities): 
+Computer Skills:  Good working knowledge of Microsoft Word; some knowledge of Excel.  Excellent keyboarding skills.  Able to produce letters and documents in a professional manner.
+Oral and Written Communication:  Able to communicate clearly and effectively on a one-to-one basis or to a group.  Writes clearly and edits work for grammar and spelling.  Able to prepare professional looking documents for vision trip participants. 
+People Skills:  Enjoys meeting and visiting with major donors.  Demonstrates good listening skills.  Capable of making people feel appreciated and needed.  Takes pleasure in speaking with people on the phone and praying with them.
+Ethics:  Demonstrates Christian love in daily conduct; treats people with respect; enjoys helping others by using whatever skills or abilities needed.  Agrees to uphold Mercy Ships vision and values.  
+Theology:  Has a comprehensive knowledge of the Bible and enjoys studying and teaching.  Am able to work through an interpreter to impart knowledge to others.  Am acceptable of the different teaching methods and worship styles of others.  Enjoy leading others to Christ and making disciples.
+Education and Experience:
+�	Successful completion of a Mercy Ships Crossroads Discipleship Training School, Fall 2002.
+�	Part-time work experience over a ten-year period with the Evangelical Development Ministry.
+�	Three years experience working as an Assistant Manager in a Christian Bookstore, gaining administrative experience and people skills.
+�	Adult Bible teacher for the past 25 years, teaching in the U.S., Nicaragua, and Kenya.
+�	Published author for adult and children�s Bible studies.  Materials being used around the world.  Currently working on a children�s series about Mercy Ships.
+","Y"
+"RS1020",32927,"BUSN","none","none","Y"
+"RS1021",32928,"BUSN","none","none","Y"
+"SL1000",32929,"SALE","none","none","Y"
+"SL1001",32930,"SALE","none","none","Y"
+"SL1002",32931,"SALE","none","none","Y"
+"SL1003",32932,"SALE","none","none","Y"
+"SL1005",32934,"SALE","none","none","Y"
+"SL1006",32935,"SALE","Management, operation and development of the IOC General Store","? Oversees management, operation and development of the General Store. 
+? Responsible for cash register, daily reconciliation report, delivering cash, checks, credit card vouchers and IPOs to Accounting, and for security and cleaning of the Store. 
+? Maintains petty cash for General Store.
+? Purchasing agent for merchandise to be sold in the Store.
+? Makes arrangements for concessions featured in the Store. 
+? Liaises with Communications, Executive Events, Resource Development, Fulfillment, the ships and other land-based offices regarding Mercy Ships logo merchandise. 
+? Liaises with HR and schools regarding arrangements for volunteers and students working in the Store. 
+? Schedules, trains and supervises staff, volunteers and students working in Store. 
+? Prepares annual budget for the Store. 
+Qualifications (Knowledge, Skills, and Abilities): 
+Recommended to have successfully completed a DTS/Crossroads. Must meet requirements set by the Campus Services Department. Leadership ability, flexibility, people skills a must for working with vendors and contractors. Good time management skills.
+Education and Experience:
+High school diploma. Retail experience useful. 
+","Y"
+"SL1007",32936,"SALE","none","none","Y"
+"SL1008",32937,"SALE","none","none","Y"
+"SL1009",32938,"SALE","none","none","Y"
+"SL1010",32939,"SALE","none","none","Y"
+"TS1000",32940,"HOST","none","none","Y"
+"TS1001",32941,"HOST","none","none","Y"
+"TS1003",32943,"HOST","none","none","Y"
+"TR1000",32944,"PAST","Oversight of Crossroads staff, curriculum, with hands-on involvement in lecture and outreach portions of program.","none",
+"TR1001",32945,"BUSN","
+","none",
+"TR1002",32946,"PAST","Involved in the preparation process of programs, hands-on leadership of various activities throughout the course of the program, including small group leadership.","none",
+"TR1003",32947,"PAST","Oversight of the DTS staff; curriculum, lecture and outreach portions of program.","none","Y"
+"TR1004",32948,"PAST","none","none","Y"
+"TR1005",32949,"PAST","Hands-on leadership of DTS, with oversight of students and staff throughout lecture and outreach phase","none","Y"
+"TR1006",32950,"BUSN","Processing of files of incoming program participants, including follow-up communication with participants and program directors.","none","Y"
+"TR1007",32951,"BUSN","none","none","Y"
+"TR1008",32952,"PAST","Involved in the preparation process of programs, hands-on leadership of various activities throughout the course of the program, including small group leadership.","none","Y"
+"TR1009",32953,"BUSN","Oversight of Training Programs with oversight of curriculum and staff, etc.","none","Y"
+"TR1010",32954,"PAST","none","none","Y"
+"TR1011",32955,"BUSN","none","none","Y"
+"TR1013",32956,"BUSN","none","none","Y"
+"TR1015",32958,"BUSN","Registrar, logistical planner and coordinator for the lecture and outreach phase of each session of X-treme Summer.� Leads the X-treme Summer programs when students are present; and teaches, directs and oversees the X-treme Summer staff.","none","Y"
+"TR1016",32959,"PAST","Responsible for fulfilling specific delegated tasks and job responsibilities (i.e.. photographer, recreation coordinator, outreach leader) during the preparation time, lecture phase and outreach of each session.� Staff are responsible for facilitating a life changing experience for all the participants of X-treme Summer to the best of their ability.","none","Y"
+"TP1000",32961,"MANT","none","none","Y"
+"TP1001",32962,"MANT","none","none","Y"
+"TP1002",32963,"MANT","none","none","Y"
+"MD1030",33309,"MEDT","none","none","Y"
+"MD1031",33310,"MEDT","none","none","Y"
+"MD1032",33311,"MEDT","none","none","Y"
+"MD1033",33312,"MEDT","none","none","Y"
+"MD1034",33313,"MEDT","none","none","Y"
+"MD1035",33314,"MEDT","none","none","Y"
+"MD1036",33315,"MEDT","none","none","Y"
+"MD1038",33317,"MEDT","none","none","Y"
+"MD1039",33318,"MEDT","Works in conjunction with the community health team physician to provide health care assessment and treatment for patients in the village Medical Clinics.","none","Y"
+"MD1040",33319,"MEDT","none","none","Y"
+"MD1041",33320,"MEDT","none","none","Y"
+"MD1042",33321,"MEDT","Oversee the acquisition and management of pharmaceuticals for Mercy Ships. Provide consultation to the medical staff regarding pharmaceutical selection and management. Maintain inventory of pharmaceuticals for the use in medical outreaches. Provide guidelines for the use, storage and distribution of pharmaceuticals.","none","Y"
+"MD1043",33322,"MEDT","none","none","Y"
+"MD1044",33323,"MEDT","Needed to work alongside other medical professionals, in the evaluation and treatment of patients within the village clinic setting.","none","Y"
+"MD1045",33324,"MEDT","none","none","Y"
+"MD1046",33325,"MEDT","none","none","Y"
+"MD1047",33326,"MEDT","To assist in fulfilling the overall vision of Mercy Ships through acquisition of donated medical supplies and equipment for the ships.","none","Y"
+"MD1048",33327,"MEDT","To assist in fulfilling the overall vision of Mercy Ships through acquisition of donated medical supplies and equipment for the ships.","none","Y"
+"MD1049",33328,"MEDT","Perform diagnostic X-rays on patients pre and postoperatively.","none","Y"
+"MD1050",33329,"MEDT","Work within the village clinic setting in variety of possible roles:  registration and assessment of patients, community health education. Administer medications, provide wound care and other medical support services. ","none","Y"
+"MD1051",33330,"MEDT","none","none","Y"
+"MD1052",33331,"MEDT","none","none","Y"
+"MD1053",33332,"MEDT","Clean and sterilize surgical instruments and medical equipment. Maintain inventory as directed by Operating Room Supervisor","none","Y"
+"MD1054",33333,"MEDT","none","none","Y"
+"MD1055",33334,"MEDT","none","none","Y"
+"MD1056",33335,"MEDT","Work within the village clinic setting in variety of possible roles:  registration and assessment of patients, community health education. Administer medications, provide wound care and other medical support services.","none","Y"
+"MD1057",33336,"MEDT","none","none","Y"
+"MD1059",33337,"MEDT","none","none","Y"
+"MD1060",33338,"MEDT","none","none","Y"
+"MD1061",33339,"MEDT","Provides direct patient care for patients before and after surgery. Implements plan of care established for each patient and documents care given.","none","Y"
+"MD1062",33340,"MEDT","none","none","Y"
+"MD1063",33341,"MEDT","Provide logistics for Mercy Ships as a whole. Determines the most cost effective and timely method for shipping supplies and materials to and from the IOC, the ships and other land base locations. Keeps abreast of the latest shipping methods. Is knowledgeable regarding transportation companies and national and international customs regulations. Manages the paperwork and all forms necessary to ship supplies to designated locations. Provides assistance in the IOC warehouse as needed.","none","Y"
+"MD1064",33342,"MEDT","Provide warehouse support services for Mercy Ships as a whole. Oversee and ensure the most effective inventory control, shipping, and receiving procedures are in place and running. Have knowledge of up to date shipping methods, transportation companies, national and international custom regulations. Determines that all paperwork, forms, and inventory systems, shipping, receiving, and accounting are maintained and correct before processing.","none","Y"
+"MD1065",33343,"MEDT","Provide warehouse support services for Mercy Ships as a whole. Oversee the daily operations of the IOC warehouse. Provide direction to warehouse officers in areas of inventory, palletizing supplies, loading, unloading shipping containers.","none","Y"
+"MD1066",33344,"MEDT","none","none","Y"
+"OP1000",33345,"MEDT","none","none","Y"
+"OP1001",33346,"MEDT","Examine and evaluate patients for optical medical/surgical intervention. Provide corrective and restorative surgery and follow up examinations to eye patients.","none","Y"
+"OP1002",33347,"MEDT","none","none","Y"
+"OP1003",33348,"MEDT","none","none","Y"
+"OP1004",33349,"MEDT","Perform refractions, adjust, fit and repair eyeglasses.","none","Y"
+"OP1005",33350,"MEDT","Perform patient examinations, refractions, prescribe and perform treatment for eye conditions.","none","Y"
+"SR1000",33351,"MEDT","Provides anaesthetic care to patients undergoing surgery. Orients new anaesthetic staff to the operating room and Ward procedures, policies, and layout.  Oversees stock of anaesthetic supplies and equipment readiness. Organizes Duty Anaesthetist schedule and communicates to Ward and staff. Participates in on-call coverage for emergencies in the OR and on the Ward.","none","Y"
+"SR1001",33352,"MEDT","none","none","Y"
+"SR1002",33353,"MEDT","Clean and sterilize surgical instruments and medical equipment. Maintain inventory as directed by Operating Room Supervisor","none","Y"
+"SR1003",33354,"MEDT","none","none","Y"
+"SR1004",33355,"MEDT","Develop fleet-wide plan for staffing, maintaining and running Anesthesia positions to support Outreach phases of each vessel.","none","Y"
+"SR1005",33356,"MEDT","Examine, evaluate and treat patients with corrective and restorative maxillo-facial surgery.","none","Y"
+"SR1006",33357,"MEDT","Circulate in the operating room. Organizes supplies prior to surgery, checks patients in before surgery. Prepares surgical instruments and equipment. Sets up sterile field and assists surgeon during surgeries. ","none","Y"
+"SR1007",33358,"MEDT","none","none","Y"
+"SR1008",33359,"MEDT","none","none","Y"
+"SR1009",33360,"MEDT","none","none","Y"
+"SR1010",33361,"MEDT","none","none","Y"
+"SR1011",33362,"MEDT","none","none","Y"
+"SR1012",33363,"MEDT","Examine and evaluate patients for orthopedic surgical intervention. Provide corrective and restorative surgery and follow up examinations to orthopedic patients.","none","Y"
+"SR1013",33364,"MEDT","none","none","Y"
+"SR1014",33365,"MEDT","Care for and monitor patients in the immediate post-operative period while they recover from general or spinal anesthesia.","none","Y"
+"SR1015",33366,"MEDT","Prepares surgical instruments and equipment. Sets up sterile field and assists surgeon during surgeries.","none","Y"
+"SR1016",33367,"MEDT","none","none","Y"
+"DS1006",28000135,"BUSN","To process donations, send ackowledgements, and appropriate correspondance to Partners.
+Be fully aware of all donation handling processes at a National Office.","Created for UK Office use","Y"
+"MS1019",36225,"SHIP"," Coordinates repair and maintenance functions for the operating fleet to minimize down time and cost of repairs by performing the following duties.
+","Essential Duties and Responsibilities (include but not limited to):
+?	Monitors routine and corrective maintenance on board fleet vessels using AMOS D
+?	Reviews repair requests and compares requests with previous work accomplished on ship concerned and similar vessels to determine that expenditures are economically sound.
+?	Prepares recommendations for work, and initiates procurement of materials when required.
+?	Inspects machinery, equipment, or spaces outlined in work request, draws up job specifications, and obtains bids from contractors or shipyards to perform repairs.
+?	Maintains contact with contractors to ensure completion of work at minimum cost.
+?	Investigates machinery casualties to determine cause, and advises ship's officers in methods of operation to prevent recurrence of casualty or malfunction.
+?	Maintains records of engineering costs for each vessel such as repairs, supplies, and personnel.
+?	Ensures the vessels are up to date regarding classification requirements.
+?	Cooperates with regulatory bodies to ensure that requirements for alterations, repair, or modifications are kept at minimum cost consistent with safety.
+Qualifications (Knowledge, Skills, and Abilities): 
+To perform this job successfully, an individual must be able to perform each essential duty satisfactorily. The requirements listed below are representative of the knowledge, skill, and/or ability required. Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+
+Ability to read, analyze, and interpret general business periodicals, professional journals, technical procedures, or governmental regulations.  Ability to write reports, business correspondence, and procedure manuals.  Ability to effectively present information and respond to questions from groups of managers, contractors, suppliers and the general public.
+
+Ability to define problems, collect data, establish facts, and draw valid conclusions. Ability to interpret an extensive variety of technical instructions in mathematical or diagram form and deal with several abstract and concrete variable
+Education and Experience:
+Will have met all expectations set forth by the Human Resource Department and preferably completed a DTS/CDTS.  Bachelor's degree (B.Sc.) from four-year college or university; or one to two years related experience and/or training; or equivalent combination of education and experience.
+
+Class I Motor Certificate of Competency according to STCW 95 preferred or equivalent certificate and/or experience.
+Work Environment:
+The work environment characteristics and physical demands described here are representative of those an employee encounters while performing the essential functions of this job. Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+
+While performing the duties of this job, the employee is frequently required to sit and talk or hear.  The employee is occasionally required to stand; walk; climb or balance; and stoop, kneel, crouch, or crawl.  The employee must occasionally lift and/or move up to 50 pounds.  Specific vision abilities required by this job include close vision.
+
+This employee must have the ability to travel internationally for periods up to three weeks.
+
+","Y"
+"MS1020",36226,"SHIP","none","none","Y"
+"MS1021",36227,"SHIP","none","none","Y"
+"MS1022",36228,"SHIP","none","none","Y"
+"MS1023",36229,"BUSN","none","none","Y"
+"MS1024",36230,"BUSN","none","none","Y"
+"MS1026",36232,"BUSN","none","none","Y"
+"MS1027",36233,"SHIP","none","none","Y"
+"MS1028",36234,"SHIP","none","none","Y"
+"EX1039",36237,"BUSN","none","none",
+"HR1019",36265,"BUSN","none","none","Y"
+"HR1020",36266,"BUSN","The Staff-in-Process (SIP) is a probationary period of employment with Mercy Ships.  During this period, the staff member is responsible to work with their ACE Coach for the purpose of developing a support base to enable long-term service with Mercy Ships.","*Preparation of presentations
+*Completion of Bible Study assignments
+*Development of personal support team
+*Creation and distribution of  newsletters, funding requests and other related communication pieces
+*Meeting with individuals and churches to explain Mercy Ships and personal vision
+*Complete and return bi-weekly status reports to the ACE office
+*Maintain records relating to persons and organizations contacted 
+
+Qualifications: 
+*Must have successfully competed a DTS, CDTS or other accepted training program, or
+*Must be accepted to begin a DTS, CDTS or other accepted training program to begin within 180 days
+*Must be a member of the Mercy Ships Religious Order
+*Must have a completed budget on file in Human Resources
+*Must be able to communicate effectively verbally and in writing
+*Must be able to organize time and duties in a non-office environment
+
+Work Environment:
+Some travel required as appropriate to accomplish stated requirements
+",
+"MD1067",36442,"MEDT","These are special projects that will be assigned by the HCS Director on an as-needed basis.","none","Y"
+"EX1040",36443,"BUSN","none","none","Y"
+"FL1005",36466,"BUSN","Help with administrative duties as needed.","Help with administrative duties as needed.",
+"TR1020",36720,"EDUC","Student
+","Student",
+"TR1021",36721,"EDUC","ICS Student
+
+","ICS Student",
+"EX1004",36730,"BUSN","A Mercy Ships Project Specialist will focus on projects specifically assigned by his or her manager. Each project may be called to analyze human, technical, educational, management, and work process systems within Mercy Ships with a view to adding efficiency, additional or new systems, new work processes, or other value-adds.  The Project Specialist will work closely with others (I would suggest removing �in management� since a lot of what he (they) will do will most likely be working with non-management personnel) in management to assure uniform relationships while working to add value and efficiency to Mercy Ships systems.","*In conjunction with reporting manager, Identify appropriate projects, goals, and objectives for a specific project
+*Liaise with appropriate personnel/stakeholders who have direct and/or indirect involvement with a project
+*When necessary, provide project management and design 
+*Coordinate with appropriate personnel, be it individuals or work groups who are part of the project process
+*Design and assist in implementation of systems, etc. 
+*When necessary, provide project management, design and/or implementation of systems
+*Document/cross train any appropriate staff for new work process systems
+*Hand off completed project to administrative functionaries when completed
+	
+Final approval of projects must be signed-off by reporting manager.",
+"CM1039",36731,"COMM","To promote awareness of Mercy Ships by coordinating the Mercy Mobile with the goal of recruitment of staff and new donors.","Include, but are not necessarily limited to the following:  (Other duties may be assigned).
+*To effectively raise personal support, and report back to personal donor base.
+*To be responsible for the daily activity of the Mercy Mobile.  
+*To keep the calendar, and make all trade shows on time.
+*To maintain the Mercy Mobile in a clean and professional manner.
+*To keep an adequate inventory of literature, books, brochures and videos, and to reorder stock as needed.
+*To maintain contact with the IOC and future exhibit locations on a regular basis.
+*To keep detailed records of finances and to manage the travel budget.  
+*To coordinate efforts of any support personnel who may be assigned to work the Mercy Mobile.
+*To seek out and develop media contacts at exhibit locations, and to report back on such opportunities to the IOC.
+*To develop relationships with local church congregations when possible.
+*To make a weekly report outlining the results of the week, showing a full list of contacts, along with any feedback to improve the effectiveness of the program.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+To perform this job successfully, the individual must be able to perform each essential duty satisfactorily. The requirements listed below are representative of the knowledge, skill, and/or ability required. Reasonable  accommodations may be made to enable individuals with disabilities to perform the essential functions.
+
+Education and Experience:
+B.A. in Communications recommended.  Must have successfully completed a Crossroads.   Good people skills, along with strong administration skills, are essential.  Must be a mature individual.  Should have 1 or more years experience in similar type work, and 1 year or more experience with Mercy Ships.
+
+Work Environment:
+To meet the responsibilities of this job, the Mercy Mobile Coordinator will travel with the Mercy Mobile.  If other tools or resources are needed to perform job, they may be negotiated as appropriate.  
+","Y"
+"EX1034",36733,"BUSN","Works closely with the Sr. Director of Organizational Develop and performs the following duties (Other duties may be assigned)","*Responsible for planning, designing and directing educational and development programs and systems at four levels of leadership; personal, interpersonal, managerial and organizational.  
+*Interfaces with Mercy Ships staff, department heads, and Vice Presidents when appropriate.Facilitates cutting-edge workshops and seminars in the four levels of leadership including; team building, soft-skill development, public speaking/presentation skills, organizational and team health, and The 7 Habits of Highly Effective People.Oversees and implements wide spread cultural change initiatives.  
+*Mentors and leads training groups, analyzes training needs, and ensures follow through, accountability and coaching occurs.  
+*Implementation and oversight of inculcating Mercy Ships core values ministry wide. Help develop and implement training interventions to improve the performance and overall capabilities of all staff members.
+*Balance of courage and consideration to all staff members.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+*To perform this job successfully, an individual must be able to perform each essential duty satisfactorily. 
+
+The requirements listed below are representative of the knowledge, skill, and/or ability required. 
+*Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+*Models core values.  
+*Broad based Biblical knowledge.  
+*Able to facilitate and teach.  
+*High level of people skills and emotional quota.Ability to read, analyze, and interpret general business periodicals, professional journals, technical procedures, or government regulations.  
+*Ability to write reports, business correspondence, and procedure manuals.  
+*Ability to effectively present information and respond to questions from groups of managers, staff, students and the general public.
+*Ability to calculate figures and amounts such as discounts, interest, commissions, proportions, percentages, area, circumference, and volume.  
+*Ability to apply concepts of basic algebra and geometry.
+*Ability to define problems, collect data, establish facts, and draw valid conclusions. *Personal initiative/self applications, professional communication skills, maturity, ability to handle confidentiality, people skills, loyalty.
+
+The physical demands described here are representative of those that must be met by an employee to successfully perform the essential functions of this job.  Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+
+Education and Experience:
+Bachelor's degree (B.A.) From four year college or university; or one to two years related experience and/or training; or equivalent combination of education and experience. 
+
+Work Environment:
+While performing the duties of this job, the employee is regularly required to use hands to finger, handle or feel.  The employee is frequently required to sit.  The employee is occasionally required to stand and walk.  The employee must occasionally lift and/or move up to 50 pounds.  Specific vision abilities required by this job include close vision, and ability to adjust focus.The work environment characteristics described here are representative of those an employee encounters while performing the essential functions of this job.  Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+",
+"MS1029",100002003,"SHIP","Heating, Ventilation & Air Conditioning Superintendent.
+
+
+
+
+
+
+
+","
+
+
+
+
+
+
+","Y"
+"HR1021",37141,"BUSN","Long term staff receive ""Leave of Absence"" for the following:  military, educataional, fund raising, etc.","
+",
+"EX1042",37159,"BUSN","To be added","To be added",
+"EX1043",37160,"BUSN","To be added","To be added",
+"RD1027",100002004,,"Community & Development Services.  Job Description not available
+
+
+
+
+
+
+
+
+
+","Community & Development Services.  Job Description not available","Y"
+"MS1030",100002005,"SHIP","Personal Assistant to Technical Superintendent","Personal Assistant to technical Superintendent
+
+
+
+
+","Y"
+"HR1022",37369,"BUSN","Volunteer for an hour, a day, a week, a month or a lifetime.  No skills, experience, education or expertise required to find a place at Mercy Ships.  
+","Volunteer for an hour, a day, a week, a month or a lifetime.  No skills, experience, education or expertise required to find a place at Mercy Ships.  
+
+
+
+
+
+",
+"RD1007",37542,"RVDF","REPORTS  TO:  CDS Projects Manager / Community Development Coordinator.
+
+QUALIFICATIONS:  Competence and experience in the occupational field being taught as well as knowledge and understanding of community development principles, teaching skills, good people skills, good communication skills, ability to work in a a team environment.
+
+NOTE: All CDS personnel must be prepared to live ashore either on advance, follow up or during outreach","RESPONSIBILITIES:
+
+Outreach Phase:
+1.  Implement the Women's Training Program or your aspect of the program if it is multidisciplinary.
+2.  Provide relevant training at a level which local people can understand.
+3.  Maintain thorough and accurate records of work accomplished, materials used and expenses incurred.  Provide written progress reports as required.
+4.  Take an interest and responsibility for spiritual needs of your Trainees.  Be aware of the spiritual climate of the region where you are working.
+
+Procurement Phase:
+
+1.  Assist with the preparation of needs lists for procurement in co-ordination with the Projects Manager and other staff.
+2.  Assist Projects Manager with overall planning of next outreach.
+3.  Assist with departmental functions as directed and contact and call on companies for procurement purposes.
+4.  Assist with practical work such as preparation and loading cargo, organizing the storeroom, etc.
+5.  Take an active part in an Advance Team if necessary.
+","Y"
+"EX1041",36743,"BUSN","none","none",
+"ED1025",36744,"EDUC","none","none",
+"MD1068",36746,"MEDT","none","none",
+"FM1036",36747,"MANT","none","none",
+"RS1022",36754,"BUSN","none","none",
+"TR1022",38178,"BUSN","none
+","none","Y"
+"EX1005",37545,"BUSN","none","none","Y"
+"MD1069",37597,"MEDT","none","none","Y"
+"HR1023",100002006,"BUSN","job descrip to come","to come","Y"
+"MI1009",37635,"BUSN","none","none","Y"
+"MS1031",100002007,"SHIP","Assistant to Technical Superintendent/Project Manager","Project Assistant","Y"
+"RS1023",37904,"BUSN","none","none","Y"
+"EX1044",38057,"BUSN","    The National Church Relations Field Director listens, encourages, and prays for the Church Relations Field Representatives.  He develops community relations, and builds church community networks.  He also oversees the National Speakers Network and pastor�s outreaches","1.	Provides needed pastoral care and support to CR Field Representatives by contacting each Field Representative weekly as necessary to encourage them in their effectiveness.
+2.	Requests by CR Field Representatives for materials, supplies, guest speaker resources, or other help are directed to appropriate IOC personnel within 48 hours of request.
+3.	Provides a monthly summary of CR Field Representatives contacts and important events to the VP Church Relations as required.
+4.	Makes at least 1 contact per month with leadership of major churches (congregations of 700 or larger) in the Dallas/Tyler area and areas not currently covered by CR Field Representatives, as resources permit.
+5.	Functions as department liaison for the National Speakers Network by training the field representatives to recruit and train alumni to be a part of the network.
+6.	Directs the Pastor�s Outreach program.
+7.	Hosts vision trips and Mission Challenge teams as necessary for the department.
+8.	Leads and teaches weekend church seminars as needed.
+Qualifications:
+�	A mature Christian with a pastoral heart.
+�	5 years in a professional position
+�	Experience in group presentations and community networking
+�	Personal appearance is appropriate for the situation.
+�	International travel is required
+Work Environment:
+     The National Church Relations Field Director is based at the International Operations Center and is provided cell phone, computer with full Partnership access, conference call speakerphone, and administrative assistance.  All approved expenses will be reimbursed from the agreed upon annual budget.
+Signature of Employee:
+
+ 	
+","Y"
+"EX1045",38058,"BUSN","Builds relationships with churches and community groups in local region by initiating new contacts with pastors and community leaders, making presentations and keeping regular contact with these churches and community groups.  Oversees the local Speakers Network.  Assists with other presentations and networking as requiered by the organization.","Essential Duties and Responsibilities (include but not limited to):
+1.	Introduces Mercy Ships to chruches in their local region by making initial contacts with Sr. Pastors, Missions Pastors and church leaders with a target of 4 such contacts per month.
+2.	Makes presentations to local churches and community groups.
+3.	Oversees the Speakers Network in their local region, trains new speakers and provides them with resource materials and pastoral care.
+4.	Is the local liaison for Weekend Church Seminars by promotion and supporting local church activities to recurit and organize for the seminars.
+5.	Works along side Gifts Officers to increase their effective network of contacts and provides prayer support through the churches.
+6.	Provides a monthly summary of contacts and important events to the National Field Director, Church Relations as required.
+7.	Assists with Work Place Giving program when needed by presenting and recruiting speakers from the Speakers Network.
+8.	The FRCR prepares and maintains an annual expense budget, and submits required expense documentation. 
+9.	The FRCR will set and pursue personal, spiritual and professional growth and education objectives, and manage time to meet those objectives.
+10.	The FRCR will enlist a personal prayer team, taking these volunteers to support travel, contacts and family and personal requests. The team will receive a written update not less than quarterly.
+Qualifications (Knowledge, Skills, and Abilities): 
+�	A mature Christian with a pastoral heart.
+�	Experience in group presentations and community networking.
+�	Personal appearance appropriate for the situation.
+�	Local travel is required.
+Education and Experience:
+Work Environment:
+If the FRCR is based outside Texas, he or she will maintain a home office from which he will contact church and community leaders and prospects by phone, mail and email. FRCR should have a car, a current US passport, and high-speed internet access.  The home office should be free from distractions that will interfere with professional communications.  A minimum time commitment of fourty hours per week is expected, but the work schedule will be flexible, including night and weekend work.  Mercy Ships will provide a computer, printer/fax, cellphone, appropriate software, and will reimburse phone, internet and mail expenses.  Reasonable travel and entertainment expenses will be reimbursed with prior approval.
+Participation in team meetings whether by conference call or at the home office will be essential with some periodic travel required to the IOC.
+","Y"
+"ED1026",38183,"EDUC","none
+","none",
+"ED1027",38184,"EDUC","To facilitate the development of medical education courses, in collaboration with HealthCare Services staff at the IOC and on the ships","?	Providing leadership, direction and support for medical education initiatives 
+?	Working collaboratively with HealthCare Services staff at the IOC and on the ships, to identify educational needs and develop courses suitable for and attractive to potential medical staff 
+?	Developing and expanding the scope and impact of teaching on worldview and developmental thinking within the courses 
+?	Preparation and/or delivery of educational materials, manuals and courses
+?	Supervising staff of the Medical Education department through individual and group training and direction, fostering teamwork and formal and informal evaluation of effective job performance
+?	Assisting in the development of department and course budgets and control of expenses
+?	Other appropriate duties and responsibilities as assigned by the reporting manager
+Qualifications (Knowledge, Skills, and Abilities): 
+Recommended - successful completion of Mercy Ships orientation program(s)
+Leadership and problem-solving skills
+Good communication skills (interpersonal, verbal, written, presentations) Ability to write clear, concise reports, business correspondence, and various types of educational and training materials and manuals. Ability to present information effectively verbally, in writing, on web pages, and to respond to questions, for groups of managers, staff and course participants.
+Good computer skills. Ability to fluently use word processing, spreadsheet, contact management, presentation and database programs.
+
+Education and Experience:
+Educational and professional qualifications at graduate level
+Experience in adult education, and/or education administration
+Experience of education/training course design and delivery
+Experience of research methods, and literature and Internet searching
+Experience of handling and interpreting technical and business information 
+Work Environment:
+While performing the duties of this job, the employee is regularly required to use a desktop computer. Some evening and weekend working required. 
+","Y"
+"MD1070",38189,"MEDT","Consult/provide assistance with the design and outfitting of the medical ward onboard the M/VAfrica Mercy.","?	Provide assistance to the Sr. Director with daily operations.
+?	Facilitate special projects for the Sr. Director, specifically in relation to the design of the medical ward of the M/V Africa Mercy.
+?	Keep regular and open communication with the Sr. Director.
+?	Provide support of projects taken on by HealthCare Services.
+?	Maintain confidentiality of all client/personnel/organizational files.
+Qualifications (Knowledge, Skills, and Abilities): 
+To perform this job successfully, an individual must have good leadership, communication and organizational skills. These include, but are not limited to the following:
+�	Thorough knowledge of medical equipment, supplies and terminology
+�	Ability to operate a computer and supportive software (incl. Internet, spreadsheet and word processing programs)
+�	Ability to operate job-related equipment and tools
+�	Ability to manage multiple projects
+�	Ability to communicate effectively in oral and written form
+�	Ability to research and understand government customs and immigration/visa requirements
+�	Ability to read, analyze, and interpret general business/medical/dental periodicals, professional journals, technical procedures or government regulations.
+�	Ability to write reports, business correspondence and procedure manuals.
+�	Ability to effectively present information and respond to questions from groups of people and individuals (managers, staff, students, the general public and developing world nationals).
+�	Thorough knowledge of basic mathematical skills
+Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+Education and Experience:
+Successful completion of DTS/CDTS; High School Diploma or Equivalent GED required; Experience in Health Care Administration or business experience preferred (Administrator, Physician, Nurse, Dentist, Pharmacist)
+Work Environment:
+While performing the duties of this job, the employee is regularly required to use hands to finger, handle or feel.  The employee is frequently required to sit.  The employee is occasionally required to stand and walk.  The employee must occasionally lift and/or move up to 25 pounds.  Specific vision abilities required by this job include close vision, and ability to adjust focus.  The conditions will vary with the task.  For the majority of the time, the environment will be that of an office.  The individual will work alone at times, but will also work in a team setting.  The noise level in the work environment is usually quiet.
+
+International travel may be required, and therefore, the employee must have a valid passport, as well as appropriate visas and immunizations, which may be required for travel to certain international destinations.
+","Y"
+"HR1024",38191,"BUSN","Responsible for the daily care and contact as it pertains to staff and extended family (ie birthdays, welcomes, orientation, addition to family, sickness, etc.)","?	Track all arrivals and departures updating intranet as well as making oral presentations at our weekly community times
+?	Update staff birthday records (including spouse and children)
+?	Send birthday cards, welcome notes, notes of encouragement, etc. to staff and families of staff
+?	If someone is ill, arrange dinners for family
+?	Build an �on-call� team of people who would be willing to get a call asking for help with a meal
+?	Develop a �welcome package� for new staff (ie. Name badge, something that represents MS, a welcome card, etc.)
+?	Deliver New Staff Orientation on an as-needed basis
+?	Give local tour for all new staff (short and long-term staff)
+?	Work with Volunteer Coordinator to coordinate tours of new staff
+?	Keep staff Orientation Manual updated as needed 
+?	Organize and Plan for Monthly Ice Cream Social (Departmental Recognition)
+?	Help, as needed, the organizer of the Community Lifestyles (hospitality)
+?	Help Orientation Coordinator (on an as-needed basis)
+?	Send a note of encouragement to the college students (of MS Parents) once a month, and possibly a care package once or twice a year (as fund allow)
+?	Develop and implement a standard �thank you for serving� letter for short-term and long-term (signed by Don Stephens)
+Qualifications (Knowledge, Skills, and Abilities): 
+Very good people skills; ability to discern �how much help is needed and when�; develop and manage tracking systems for birthdays, arrivals and departures; speaking skills a must; must possess a gentle nature � intuitiveness, sensitivity a must! Ability to �look for a bargain� (ie. Utilize food bank, build up a �card� collection, etc.
+Education and Experience:
+Associate of Arts degree desired. Job equivalent experience can be substituted. Natural gift of hospitality is essential.
+Work Environment:
+Be able to work dependently, coordinate the efforts of a group, and be accountable on a weekly basis as to weekly activities.
+Signature of Employee:	
+Date:	
+
+","Y"
+"EX1100",38192,"BUSN","None
+
+","None",
+"DK1102",38281,"SHIP","none","None","Y"
+"DK1110",38282,"SHIP","None","None","Y"
+"DK1132",38283,"SHIP","None","None","Y"
+"DK1144",38284,"SHIP","None","None","Y"
+"DK1154",38285,"SHIP","None","None","Y"
+"EN1112",38286,"SHIP","None","None","Y"
+"EN1118",38287,"SHIP","None","None","Y"
+"EN1124",38288,"SHIP","None","None","Y"
+"EN1128",38289,"SHIP","None","None","Y"
+"EN1130",38290,"SHIP","None","None","Y"
+"EN1138",38291,"SHIP","None","None","Y"
+"EN1142",38292,"SHIP","None","None","Y"
+"DK1100",32645,"SHIP","Ensure safety, and legal compliance of the crew and ship.  Operational oversight and Conduct regular performance reviews of staff.  This person needs to meet the requirements of (STCW 95 II/2)","none","Y"
+"DK1104",32638,"SHIP","The 1st Officer reports to the master and is responsible for the entire deck department.  This person needs to meet the requirements of (STCW 95 II/2)","none","Y"
+"DK1106",32616,"SHIP","General responsibility for maintenance and operation of ship's navigation equipment, including helm, compasses, charts and publications, navigation instruments, signal gear (visual and sound), and general housekeeping of the bridge and flying bridge.  This person needs to meet the requirements of (STCW 95 I/1)
+","none","Y"
+"DK1112",32617,"SHIP","General responsibility for maintenance and operation of lifesaving and firefighting equipment, in accordance with ship's maintenance schedule and statutory inspections.  This person needs to meet the requirements of (STCW 95 II/1)","none","Y"
+"DK1114",32648,"SHIP","The safety officer shall be conversant with the company's safety and enviromental policy, an dreport to the master after investagation if there are any deficiencies in the ship in respects to safety managemnet system an or the Safety and Enviromental policy.  This person needs to meet the requirements of (STCW 95 II/1)","none","Y"
+"DK1118",32644,"SHIP","Minimum of experience or training in seamanship. Primary duties include watchstanding, in port and underway; participating in deck training programs to increase knowledge of seamanship; working as directed by the Bosun in a variety of maintenance tasks or operations.  This person needs to meet the requirements of (STCW 95 II/1)","none","Y"
+"DK1120",37318,"SHIP","Responsible for the day to day management of the deck crew. 
+
+CERTIFICATES/LICENSES/EXPERIENCE:
+At least Certificate of Competency according to STCW 95 Section A-II/4
+It is required to have practical and theoretical knowledge with regard to use of hand tools and portable power tools.
+
+LANGUAGE SKILLS:
+Ability to read and interpret documents such as safety rules, operation and maintenance instructions and produce manuals. Ability to write routine reports and correspondence.  Abiliy to effectively communicate with subordinates and senior management in clear English.
+
+
+
+
+
+
+
+","Scheduling work assignments in cooperation with the Chief Officer.  
+Assigning crew members to specific tasks, working with them as necessary. 
+Overseeing work in progress with an eye towards efficiency, cooperation, and safety, giving instructions as necessary.
+Implementing daily plans, schedules, and instructions given by the Chief Officer.  Cooperating with the other deck officers as needed in their areas of responsibility.  Caring for the deck crew in regards to morals and spiritual welfare, in conjunction with the Chief Officer.
+Assisting with the training of deck crew.
+Supervision of storage in Bosun's locker, paint locker, store rooms and workshops.
+Awareness of Company SMS.","Y"
+"DK1122",37319,"SHIP","Responsible for assisting in the day to day supervision of the deck crew.
+
+CERTIFICATES/LICENSES/EXPERIENCE:
+At least Certificate of Competency According to STCW 95 A-II/4
+It is required to have practical and theoretical knowledge with regard to use of hand tools and portable power tools.
+
+LANGUAGE SKILLS:
+Ability to read and interpret documents such as safety rules, operating and maintenance instructions and procedure manuals.  Ability to write routine reports and correspondenc.  Ability to effectively communicate with subordinates and senior management in clear English.
+
+","Overseeing work in progress with an eye towards efficiency, cooperation, and safety, giving instructions as necessary.
+Undertaking tasks and working alongside the other deck crew as necessary.
+Taking a special interest, on behalf of the bosun, in the proper use and care of deck equipment, supplies, and material.
+Maintaining equipment as necessary and instructing others of the deck crew in the use of the equipment/material as necessary.
+Assisting the deck officers and bosun with the shipboard training program.
+Assisting with supervision of storage in Bosun's locker, paint locker, storerooms and workshops.
+Awareness of Company SMS.
+","Y"
+"DK1124",32618,"SHIP","Trained in all aspects of good seamanship, with special emphasis on launching and handling of lifeboats. Qualified as a close-quarters helmsman, familiar with standard helm orders.  This person needs to meet the requirements of (STCW 95 II/4)","none","Y"
+"DK1126",32646,"SHIP","Responsible to the first officer, through the bosun and assistant bosun, for general duties, and to specific officers for special tasks.  Also responsible to the officer of the watch/day, during periods on bridge/gangway watch or on saftey/security patrol. This person needs to meet the requirements of (STCW 95 II/4) ","none","Y"
+"DK1128",32639,"SHIP","NO STCW Requirements","none","Y"
+"DK1130",32651,"SHIP","Reports to the Bosun for general duties and the first officer for duties concerning fresh water on board the ship.  No STCW Requirements.","none","Y"
+"DK1134",32641,"SHIP","In addition to the duties of a general seaman/AB, the deck mechanic will have specific duties that relate to the maintenance of the ship's cargo equipment and deck machinery. This person needs to meet the requirements of (STCW 95 II/4)","none","Y"
+"DK1136",32643,"SHIP","In addition to the duties of a General Seaman/AB, the fireman will have specific duties relating to the maintenance of fire fighting equipment.  This person needs to meet the requirements of (STCW 95 II/4)","none","Y"
+"DK1138",32635,"SHIP","In addition to the duties of a General Seaman/AB, the fireman will have specific duties relating to the maintenance of fire fighting equipment. And assisting the ship's fireman with his duties.  This person needs to meet the requirements of (STCW 95 II/4)","none","Y"
+"DK1140",32649,"BUSN","Responsible for typing, completing Purchase Orders, mail, filing, and other clerical duties as needed by deck staff.","none","Y"
+"DK1142",32650,"SHIP","Assist Captain and Chief Engineer in the operation of shipboard Safety Management System (SMS), including timely entry of data in reports and records, and forwarding of reports as directed.
+","none","Y"
+"DK1150",32637,"SHIP","none","none","Y"
+"DK1152",32647,"SHIP","Responsible for the completion of approved renovations, as assigned by the Renovation Management Team.  Work with the Renovation Management Team in the planning process, providing estimates of labor, material, and tools.  Supervise, or as needed, carry out the work.","none","Y"
+"EN1100",32686,"SHIP","The Chief Engineer is the head of the engine department and is responsible to the Master for adminisrtation, supervision, and safe economical operation of the engine department.  This person needs to meet the requirements of (STCW 95 III/2)","none","Y"
+"EN1104",32684,"SHIP","Execute all orders given by the Chief Engineer and the 1st Engineer.  Execute all duties and maintenance routines for but not limited to, the following: Auxiliary engines, Stock control of auxiliary engine spares and all chemicals on board.  This person needs to meet the requirements of (STCW 95 III/3)","none","Y"
+"EN1114",32697,"SHIP","Execute all orders given by the Chief Engineer and the 1st Engineer.  Execute all duties and maintenance routines for but not limited to, the following: Lifeboat engine, boiler and engine cooling water systems, all purifiers, assist chief engineer in all operation involving fuel, diesel, and bunkering, and all air compressors.  This person needs to meet the requirements of (STCW 95 III/1)","none","Y"
+"EN1116",32700,"SHIP","Responsible for the running and maintence of all the ships man refrigeration plant and all other refridgeration machinery onboard.","none","Y"
+"EN1120",32702,"SHIP","none","none","Y"
+"EN1122",32703,"SHIP","none","none","Y"
+"EN1126",32691,"SHIP","Assists Engineer in charge of watch in the daily maintaining and maintenance of engine room auxiliary system when in port and at sea.   Maintain cleanness of E/R Equipment and structure and performs cleaning duties as needed to maintain same.    This person needs to meet the requirements of (STCW 95 III/4)","none","Y"
+"EN1134",32696,"SHIP"," Carry out routine fabrication and repair of machinery items and parts of shipboard equipment under direction of Chief Engineer.  Cary out routine maintenance, installation and troubleshooting of plumbing systems, both gravity and vacuum systems as needed.","none","Y"
+"EN1140",32701,"BUSN","Responsible for typing, completing Purchase Orders, mail, filing, and other clerical duties as needed by engineering staff.","none","Y"
+"EN1144",100002001,"SHIP","Translation of many Technical Documents from Danish to English.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+","As above
+","Y"
+"EN1150",32685,"SHIP","Reports to Chief Engineer regarding the maintenance and routine inspection of all electrical machinery and equipment.  No STCW Requirements.","none","Y"
+"EN1152",32683,"SHIP","none","none","Y"
+"EN1154",32687,"SHIP","Maintain ship�s 24 through 600 volt electrical systems. Install new electrical equipment.  Carry out Electrical Assistant�s responsibilities when no assistant is available.","none","Y"
+"EN1156",32688,"SHIP","none","none","Y"
+"EN1158",32693,"SHIP","none","none","Y"
+"EN1159",32689,"SHIP","none","none","Y"
+"EN1160",32694,"SHIP","none","none","Y"
+"EN1162",32698,"SHIP","none","none","Y"
+"EN1164",32705,"BLDG","Assist Chief Engineer in the installation and maintenance of various ship's structure and piping systems.","none","Y"
+"EN1166",32706,"BLDG","none","none","Y"
+"EN1170",32695,"SHIP","Responsible for all plumbing systems, metal fabrication and repair, supervises all welders and plumbers.","none","Y"
+"EN1172",32699,"BLDG"," Carry out routine fabrication and repair of machinery items and parts of shipboard equipment under direction of Chief Engineer.  Cary out routine maintenance, installation and troubleshooting of plumbing systems, both gravity and vacuum systems as needed.","none","Y"
+"RD1019",38320,"MEDT","none","noone","Y"
+"OT1013",38443,"BLDG","none--see below","RESPONSIBILITIES:
+1.	Oversees the administration and implementation of the Adult Basic Education (ABE) program in developing nations
+2.	Develops and revises ABE curriculum through active participation in classroom settings, and in response to program evaluations, governmental requests, and ongoing research
+3.	Seeks to improve personal knowledge base in the areas of adult literacy, education, and ways of integrating the Christian message in the ABE program
+4.	Responsible for maintaining supply of adult educational resources and distributing them to partners and collaborators (i.e. New Steps, Ministry of Education)
+5.	Organizes and coordinates participation of outside teams, special speakers, and projects within the learning sites
+6.	Mentors and supervises volunteer tutors who help program participants with weekly studying and reading sessions
+7.	Coordinates ABE team meetings and assists in planning schedules
+8.	In cooperation with the Program Development Coordinator, assists in the administration of project funding initiatives including research, grant writing, ongoing communication and follow-up
+9.	Is willing to adapt to differing cultures and locations, and to work flexible hours and days
+10.	Is willing to do advance work in developed or developing nations
+","Y"
+"OT1015",38444,"BLDG","none","RESPONSIBILITIES:
+1.	Oversees development and quality assurance for each educational area of ORS, including the Child Development Program and Adult Basic Education
+2.	Oversees development of new programs within ORS, especially those with a community education focus (i.e., HIV/AIDS awareness, micro-enterprise seminars, etc.)
+3.	Prepares departmental concept papers, grant proposals, and other Mercy Ships documents on behalf of ORS
+4.	Responsible for preparing and getting approval for the annual department budget, including internal operations (approved by ship CFO) and external programs (approved by International Programs Group)
+5.	Responsible for ensuring the fair and effective distribution of all non-medical donated goods
+6.	Works with Advance Teams to ensure procurement of resources and awareness of ORS programs during the European public relations phase
+7.	Works with the Outreach Services Manager and Crew Outreach Coordinator to develop intra-ship education programs
+8.	Interfaces with the Anastasis CPO and IPG leaders to ensure compliance with Mercy Ships goals and policies
+
+","Y"
+"MD1071",38445,"MEDT","none
+","
+none","Y"
+"CH1008",38446,"PAST","none
+
+","none",
+"HR1025",38447,"BUSN","none
+
+","none","Y"
+"EX1046",38448,"BUSN","none","none","Y"
+"EX1047",38449,"BUSN","none","none","Y"
+"HR1026",38450,"BUSN","none","none","Y"
+"RS1024",38453,"BUSN","None","None","Y"
+"MD1072",38650,"MEDT","none","none","Y"
+"MD1073",38655,"MEDT","To facilitate the holistic rehabilitation of people with disabilities and their communities by professional treatment of referred or self-referred disabled people at the rehabilitation centre or in the community.","?	Assess all clients seen in the rehabilitation centre or screened in the communities to determine long term and short term goals for physiotherapeutic treatment. As much as possible assess with the Occupational Therapist especially concerning the need for orthoses/prostheses/mobility assist devices.
+?	Treat, at regular intervals, all clients needing physical rehabilitation who either come to the centre or are seen in their communities. This also includes physiotherapeutic treatment as preparation for fitting of orthoses/prostheses/mobility assist devices.
+?	Evaluate on a regular basis the progress made by the clients in terms of goals met, which also includes re-evaluation after fitting of orthoses/prostheses/mobility assist devices.
+?	Document evaluation, re-evaluation and treatments given on a daily basis
+?	Educate parents/caregivers and the clients in therapeutic exercises for achievement of long term goals, in management of orthoses/prostheses/mobility assist devices, and in adaptations to activities of daily living for prophylactic and therapeutic purposes and independence.
+?	Re-assessment and follow-up of progress made by patient and parent/caregiver functioning independently
+?	Refer clients for occupational therapy, measuring and fitting of orthoses/prostheses/mobility assist devices. Refer clients for family or individual counseling support, for consultation with medical staff, for micro-enterprise development, vocational training or any other services offered by Mercy Ships New Steps.
+?	Provide on the job training and consultation for national Rehabilitation Worker assistants 
+?	Meet with rehabilitation team and coordinator weekly for discussion of departmental and patient related matters
+?	Tidy and organise work area
+?	Take on role of Occupational Therapist when there is lack on the Rehabilitation team.
+QUALIFICTIONS (KNOWLEDGE, SKILLS AND ABILITY):
+Have good adaptive skills to work within a foreign environment.  Be resourceful, flexible, creative and interdependent. Be prepared to deal with personal and professional frustrations in a mature and constructive way.  Have a heart for the disabled and a sincere desire to provide physical help as well as spiritual support. Using skills and talents to spread the love of God and to be a worker in His Kingdom.
+Fluency in spoken and written English.
+EDUCATION AND EXPERIENCE:
+Graduated with degree in Physical Therapy.
+Preferably two years post-graduate experience in the clinical setting. Fresh graduates and those with less experience will be considered on a case by case basis. Experience in out-patients, orthopaedics, stroke and neurological rehabilitation required.  Also lower limb prosthetic rehabilitation an asset.
+WORK ENVIRONMENT:
+Mercy Ships New Steps is a land based programme working out of Freetown, Sierra Leone, West Africa.  Most clients we see are destitute people living on or below the poverty line and have very few resources The climate is very hot and humid the treatment room part of Rehabilitation Suite has a fan.  Work in the community can be in difficult conditions (hot, many people around, on the ground, sometimes in rainy conditions, etc).
+","Y"
+"HR1027",38677,"BUSN","Caregiver will be the parent responsible for children and will not be holding an allocated position on board.","none","Y"
+"PRA1000",38721,"BUSN","The Director of Public Relations plans (DPR), organizes, leads and monitors all aspects of ship visits in the US and Canada. 
+
+","Essential Duties and Responsibilities (include but not limited to):
+ ?	The DPR is responsible for the initial assessment and planning of which cities will be visited by an available ship.  Final approval of ship PR visit itinerary is in colaboration with the Executive Director of the vessel, Operations Director of the vessel and the appropriate members of the Executive Management Team at the IOC.
+?	The DPR is responsible for the process of identifying potiential hosts to host the ship visits.
+?	The DPR works to secure corporate sponsorship for ship visits.
+?	The DPR overseas PR Advance teams on location.
+?	The DPR prepares and maintains the department�s annual expense budget, annual plan, three year plan, technology plan, volunteer management plan, and annual evaluation. The DPR annually evaluates his/her team of direct reports.
+
+Qualifications (Knowledge, Skills, and Abilities): 
+ The DPR should have a background in marketing. Excellent organizational and mangement skills are essential. Excellent interpersonal, verbal and written communication skills are essential. Experience with international missions and/or medical background is highly desirable.  Campaign experience is strongly desirable.  Must have a working knowledge of the Internet, email, Microsoft Office software including Word, Excel and Outlook, and have an understanding of contact management software.  SVP will be asked to sign the MS statement of faith and confidentiality agreement.  Must be:
+�	able to travel 20% of the time;
+�	a motivated, self starter with a desire to achieve personal and organizational goals;
+�	able to work alone without close, direct supervision;
+�	a person of Christian character exemplifying qualities of honesty, trustworthiness, initiative, creativity, tennacity, diligence and dependability.
+Education and Experience:
+ Should have a fruitful and growing relationship with Jesus Christ and share the values of bringing hope and healing to the world�s poor.
+
+
+
+
+","Y"
+"PRA1001",38722,"BUSN","none
+
+","none","Y"
+"RS1025",38724,"BUSN","none","none","Y"
+"EX1048",100002008,"BUSN","Personal Assistant to Executive Director.","Personal Asst. to ED","Y"
+"EX1049",100002009,"BUSN","Assistant to Operations Director (onboard a ship).","Assistant to Operations Director (onboard a ship).","Y"
+"EX1050",100002010,,"Operations Director","Operations Director","Y"
+"CM1040",100002011,"IT01","Audio Video Technician","Audio Video Technician","Y"
+"EX1051",100002012,"BUSN","Personal Asst. to Operations Director","Personal Asst. to Operations Director","Y"
+"ED1028",100002013,"EDUC","Segue School Leader","Segue School Leader",
+"MS1032",38730,"SHIP","The Company Security Officer is the main point of contact on shore for all matters relating to maritime security, whether in the company fleet of ships, or those segments of the general maritime and port state industry  with which company ships have contact, including the flag Administrations of the ships.  This individual will manage the company�s security program for ships and crew members, ensuring compliance with international, national, and local port security regulations, while optimizing the effectiveness of fleet operations.","?	Research the level of threats to be expected by each ship, according to planned itineraries, to include port operations and ocean transits;  advise this information to the ship�s Master, Port Technical Coordinator, and Safety Manager (a) prior to the ship�s arrival in that port, and (b) upon any change in the security status of the port while the ship is docked there;
+?	Monitor the forecast movements and operations of the ships in the fleet in order to detect early any deviation which may indicate a security incident;
+?	Ensure that ship security assessments are carried out in accordance with the company�s security plan;
+?	Ensure that ship-specific security plans are developed for each company ship, that these plans are submitted for approval to the appropriate authorities,and that thereafter they are implemented and maintained. 
+?	Liaise with Flag Administrations or their recognized security organization for initial and subsequent verification of these plans;
+?	Coordinate renewal of International Ship Security Certificates with Safety Manager, ships� Masters and appropriate authorities;
+?	Ensure that ongoing review of implemented ship security plans, through internal audits and reviews, and through reports of security incidents, results in modifications of the ship security plans, as appropriate;
+?	Ensure that modifications to approved ship security plans are likewise approved by the appropriate authorities;
+?	Ensure that any deficiencies and non-conformities identified during internal audits, periodic reviews, security inspections and verifications of compliance are promptly addressed;
+?	Maintain working copies of each ship�s Continuous Synopsis Record, in order to provide verification to appropriate authorities;
+?	Work to enhance security awareness and vigilance throughout the fleet;
+?	Ensure adequate training for personnel responsible for the security of the ships;
+?	Consult with the Master of each ship on the appointment of the Ship Security Officer, and maintain a record of such appointments;
+?	Ensure effective communication between Ship Security Officers and Port Facility Security 
+
+?	Research the level of threats to be expected by each ship, according to planned itineraries, to include port operations and ocean transits;  advise this information to the ship�s Master, Port Technical Coordinator, and Safety Manager (a) prior to the ship�s arrival in that port, and (b) upon any change in the security status of the port while the ship is docked there;
+?	Monitor the forecast movements and operations of the ships in the fleet in order to detect early any deviation which may indicate a security incident;
+?	Ensure that ship security assessments are carried out in accordance with the company�s security plan;
+?	Ensure that ship-specific security plans are developed for each company ship, that these plans are submitted for approval to the appropriate authorities,and that thereafter they are implemented and maintained. 
+?	Liaise with Flag Administrations or their recognized security organization for initial and subsequent verification of these plans;
+?	Coordinate renewal of International Ship Security Certificates with Safety Manager, ships� Masters and appropriate authorities;
+?	Ensure that ongoing review of implemented ship security plans, through internal audits and reviews, and through reports of security incidents, results in modifications of the ship security plans, as appropriate;
+?	Ensure that modifications to approved ship security plans are likewise approved by the appropriate authorities;
+?	Ensure that any deficiencies and non-conformities identified during internal audits, periodic reviews, security inspections and verifications of compliance are promptly addressed;
+?	Maintain working copies of each ship�s Continuous Synopsis Record, in order to provide verification to appropriate authorities;
+?	Work to enhance security awareness and vigilance throughout the fleet;
+?	Ensure adequate training for personnel responsible for the security of the ships;
+?	Consult with the Master of each ship on the appointment of the Ship Security Officer, and maintain a record of such appointments;
+?	Ensure effective communication between Ship Security Officers and Port Facility Security Officers, especially in cases where the ship may have a security level set higher than that of the port facility;
+?	Ensure consistency between security requirements and safety requirements, in consultation with the Safety Manager and ships� Masters, especially in the area of manning levels and crew hours of work;
+?	Ensure that any alternative or equivalent arrangements approved for a particular ship or group of ships are implemented and maintained;
+?	Participate in company security exercises at appropriate intervals;
+?	Maintain maritime security related reports and records in a secure manner at the company headquarters, and ensure that Ship Security Officers do the same on board each ship;
+?	Liaise with company Human Resources staff as appropriate on issues regarding security clearances and background checks of prospective crew and staff;
+?	Monitor trade publications and multi-media information sources to discern trends in security standards and incidents;
+?	Attend conferences and/or seminars on internationa maritime security, as approved by the Vice President of Marine Operations.
+?	Participate in departmental activities of the Marine Operations department at the International Operations Center (IOC).
+
+Qualifications (Knowledge, Skills, and Abilities): 
+Knowledge base and training commensurate with the IMO ISPS Code, Appendix B, Part 13.1 (SOLAS XI-2/1 as amended), such as would be obtained from completing a Company Security Officer training course from an approved provider.
+
+Administrative skills are essential, including the ability to write and speak in clear English, maintain electronic and paper files, and prepare reports in a timely manner.
+
+Education and Experience:
+Work Environment:
+Preferred baccalaureate degree, minimum high school graduate or GED.
+
+Preferred more than four years experience in maritime security or law enforcement; or senior license (management level) in maritime technical operations (Deck or Engineering).
+
+Work environment will vary from standard office with moderated climate control, to field assignments in marine industrital environment.  Employee may be exposed to loud noise levels, dusty or gaseous atmospheres, toxic chemicals, confined spaces, damp, and temperature extremes.
+","Y"
+"EX1052",38783,"BUSN","none","none","Y"
+"MD1075",100002014,"MEDT","add","add","Y"
+"MD1074",100002015,"MEDT","add","add","Y"
+"MD1076",100002016,"MEDT","add","add","Y"
+"MD1077",100002017,"MEDT","add","add","Y"
+"MD1078",100002018,"MEDT","add","add","Y"
+"MD1079",100002019,"MEDT","add","add","Y"
+"MD1081",100002020,"MEDT","add","add","Y"
+"MD1082",100002021,"HOST","add","add",
+"MD1083",100002022,"MEDT","add","add","Y"
+"MD1084",100002023,"MEDT","add","add","Y"
+"MD1085",100002024,"MEDT","add","add","Y"
+"MD1086",100002025,"MEDT","add","add","Y"
+"MD1087",100002026,"MEDT","add","add","Y"
+"SR1017",100002027,"MEDT","add","add","Y"
+"SR1018",100002028,"MEDT","add","add","Y"
+"SR1019",100002029,"MEDT","add","add","Y"
+"SR1020",100002030,"MEDT","add","add","Y"
+"SR1021",100002031,"MEDT","add","add","Y"
+"SR1022",100002032,"MEDT","add","add","Y"
+"SR1023",100002033,"MEDT","add","add","Y"
+"SR1024",100002034,"MEDT","add","add","Y"
+"MD1080",100002035,"MEDT","add","add","Y"
+"MD1088",100002036,"MEDT","add","add","Y"
+"MD1089",100002037,"MEDT","add","add","Y"
+"MD1090",100002038,"MEDT","add","add","Y"
+"0P1006",100002039,"MEDT","add","add","Y"
+"MD1091",100002040,"MEDT","add","add","Y"
+"MD1092",100002041,"MEDT","add","add","Y"
+"OP1006",100002042,"MEDT","add","add","Y"
+"PRA1002",38791,"BUSN","none","none","Y"
+"MI1010",38793,"BUSN","1.	Organize purchasing and procurement to equip outreach teams with adequate materials
+2.	Develop relationships with local churches and pastors as well as in the broader context of Mercy Ships
+3.	Recruit and participate with Nicaragua teams.
+4.	Speak at civic clubs to build MS awareness
+5.	Collate materials as needed for teams
+6.	Implement mailing schedule
+","1.  Micro Soft Word understanding (for letters and some filing)
+2.  Spiritually focused
+3.  Understanding of Mercy Ships through 2 years past experience
+4.  Some Accounting Helpful
+5.  Ability to speak and interact with public
+","Y"
+"RS1026",38794,"BUSN","The Area Gifts Officer (AGO) raises large gifts, pledges and letters of intent (LOI), from individuals, and selected foundations and corporations within an assigned geographical region. The minimum threshold for a gift, pledge or LOI is $25,000","?	The Area Gifts Officer (AGO) is responsible for the personalized contact and moves management plans of between 200-300 major donors and prospects within an assigned geography.  This case load includes existing major donors in the Mercy Ships data base, plus selected high net worth individuals, family foundations and privately held companies.  
+?	Each year the AGO selects approximately 40-50 prospects for the solicitation of a major gift.  The AGO works with senior management, selected board members and regionally based major gift volunteers to develop the plan and secure each gift. A travel plan for each quarter will be prepared and submitted for approval by the supervisor. 
+?	The AGO will recruit a regionally based team of major gift volunteers.  This committee�s task is to support the identification, qualification, involvement, and solicitation of prospects. The committee chair may be recruited by the MS Board. Meetings are called as needed. 
+?	The AGO is responsible for researching names to be added to the caseload and data base.  The data base will be continually updated with new information gathered from public sources and will include capacity, interests, relationships, and motivation data germain to establishing a growing relationship.  The data base remains the property of Mercy Ships.
+?	Progress reports will be submitted not less than quarterly on the progress made, and in the fourth quarter a monthly report will be submitted.  Reports will reflect the financial goal for each prospect and a forecast for the coming quarter. Site visit report will be filed after each trip, reflecting in summary form the purpose of each contact and its relationship to their personalized contact management plan
+?	The AGO will manage the stewardship plan for each prospect, providing a written or personal report on funds used and other information pertinent to a donor. Reports will be prepared and presented in a timely fashion.
+?	The AGO prepares and maintains an annual expense budget, and submits required expense documentation. 
+?	The AGO will set and pursue personal, spiritual and professional growth and education objectives, and manage time to meet those objectives.
+?	The AGO will enlist a personal prayer team, taking these volunteers to support travel, contacts and family and personal requests. The team will receive a written update not less than quarterly
+","Y"
+"HR1028",38795,"BUSN","none","none","Y"
+"MD1020",38797,"MEDT","Review, define, recommend and design optimal organizational methods, procedures and information systems for Mercy Ships HealthCare Services.  Supervise and participate in projects that accomplish these goals using current technology computers and related software tools.  Support projects for other departments will be considered on a priority/time available basis.  
+
+","?	Identify needed tools, methods and procedures interdepartmentally.  Determine where improvements can be achieved that will allow for better communication, more thorough reporting and more efficient and accurate business transactions.
+?	Design and/or procure software tools, spreadsheets, databases, methods, etc. that provide for more robust, more stable business systems.  These systems should be designed to provide for personnel turnover without affecting the tools and procedures required to successfully accomplish the tasks.  Intuitive interface and minimal training should be a focus in design.
+?	Supervise projects, personnel and systems to accomplish the aforementioned goals.
+?	Participate in ancillary projects on a consulting basis where assistance is needed, including but not limited to graphics, video conferencing, communications, and software training.
+?	Research effective data tools and systems on an ongoing basis in order to keep abreast of technological advancements and business trends and how they may benefit Mercy Ships.  This may include attendance at technology seminars.
+?	Represent Mercy Ships HealthCare Services interests and systems support while interfacing with other departments and locations seeking to foster unity while developing models of efficiency that can be duplicated.
+?	Assist the Operations Manager implementing the above.
+?	Maintain confidentiality of all client/personnel/organizational files.
+
+To perform this job successfully, an individual must have exemplary communication and organizational skills. These include, but are not limited to the following:
+�	Proficiency in the operation of current technology computers
+�	Needs to be familiar with current spreadsheets, word processors, presentation programs and graphics packages.
+�	It is helpful to have experience with Windows Operating Systems, networking and file transfer.
+�	Proficient in using the Internet.
+�	Be able to conduct in-service education/training for work groups. (Seminar preparation may be required.)
+�	Ability to read, analyze, and interpret general business periodicals, professional journals, technical procedures and government regulations.
+�	Ability to write reports, business correspondence, and procedure manuals.
+�	Ability to effectively present information and respond to questions from groups of managers, staff, students and the general public.  
+�	Ability to calculate figures and amounts such as discounts, interest, commissions, proportions, percentages, area, circumference, and volume.  Ability to apply concepts of basic algebra and geometry.
+�	Ability to define problems, collect data, establish facts, and draw valid conclusions
+�	Ability to interpret an extensive variety of technical instructions in mathematical or diagram form and deal with several abstract and concrete variables
+Reasonable accommodations may be made to enable individuals with disabilities to perform the essential functions.
+Education and Experience:
+Successful completion of DTS/CDTS required. Bachelor�s Degree and one or two years of experience and/or training required, or the equivalent combination of education and experience
+While performing the duties of this job, the employee is regularly required to use hands to finger, handle or feel.  The employee is frequently required to sit.  The employee is occasionally required to stand and walk.  The employee must occasionally lift and/or move up to 25 pounds.  Specific vision abilities required by this job include close vision, and ability to adjust focus. The conditions will vary with the task.  The usual environment is that of an office.  The individual may work alone at times, but will often work in a team setting.  The noise level in the work environment is usually quiet.
+
+International travel may be required, and therefore, the employee must have a valid passport, as well as appropriate visas and immunizations, which may be required for travel to certain international destinations.
+
+
+","Y"
+"MD1093",38811,"MEDT","Logistics Coordinator:  Responsible for budgeting and use of team funds. This includes the keeping of books and the allocation of funds.  Will be responsible for paying of bills and budgeting expenditures within the constraints of the budget. This person will be rsponsible for the arrangement of team transportaion and the transportation of the volunteers to and from the airport.  The acquirment of supplies and meds from the warehouse will fall within this persons jurisdiction as well as, it will require the arrangement of transportation also.","none","Y"
+"RS1027",38972,"BUSN","
+Responsible for researching and soliciting funds from Foundations, which is a substantial source of donations for Mercy Ships.
+","�	Undertake detailed research into existing Foundation donors with a view towards enhancing relations with these donors that should lead to increasing the current levels of giving.
+�	Utilize all available information to research the various types of Foundations in order to identify those most likely to support Mercy Ships.
+�	Prepare and distribute letters of enquiry to be sent to Foundations that through research have been identified as realistic prospects.
+�	Seek from these Foundations copies of Annual Reports and other information necessary for an understanding to be gained of each Foundation�s policies and objectives.
+�	Develop proposals to Foundations that have been identified as being potential Mercy Ships donors.
+�	Maintain office files of all relevant information on prospective and actual donor Foundations.
+�	Advise the Vice President Development of opportunities to visit Foundations or attend meetings, conventions or events where they may be represented.
+�	Attend training and personal development opportunities on a regular basis as well as field visits to Mercy Ships outreaches or vessels.
+�	Negotiate with the V P of Development on a financial fundraising goal for each year.
+�	Track all details of interactions with Foundations on Partnership, analysis spreadsheets, computer files and paper files. 
+
+
+
+
+
+","Y"
+"HR1029",5000011,"BUSN","none","none","Y"
+"MI1011",39119,"BUSN","none","none","Y"
+"NS1000",39120,"BUSN","
+To facilitate and support the growth of the New Steps land base and its programs towards long term community development with an emphasis on the disabled in Sierra Leone from the United States.
+","Responsibilities and Duties:
+
+1.	To represent New Steps within the IOC and provide an informed perspective concerning long term development issues surrounding New Steps Sierra Leone and possible other long term land based initiatives within Mercy Ships.
+
+2.	To cooperate with the Church Relations Department to mobilize churches to support New Steps and network with outside organizations.
+
+3.	To engage in the promotion and awareness of the New Steps program throughout Mercy Ships.
+
+4.	To recruit long term expatriate staff members for specific jobs that are available.
+
+5.	Represent and promote New Steps at  appropriate professional conferences and venues.
+
+6.	To undertake grant and proposal writing in collaboration with Resource Development, undertaking visits as necessary.
+
+7.	To provide logistical support through procurement of supplies for the various components of the program.  To coordinate warehousing and shipping through the IOC.
+
+8.	To promote and participate in Mission Challenge teams that may participate in New Steps, Sierra Leone.
+
+9.	To assist with media communication regarding the New Steps program through stories, assisting with the creation of brochures, annual report, pictorial stories, etc.
+
+10.	To undertake all other tasks as assigned by the International Director.
+","Y"

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere1.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere1.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere1.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,144 @@
+1|'Peter  Cipollone'|''|'Dow Jones Interactive Publishing'|'P.O. Box 300'|''|'Princeton'|'NJ'|'08543-0300'|''|'(609)-520-7754'|''|'peterc@wsj.dowjones.com'|''|'Peter '|'Cipollone'|'Customer'|'1998-04-01'
+2|'Douglas Ellmore'|'Project Manager'|'Electric Press'|''|''|''|''|''|''|'(703)-742-3308'|''|'de@elpress.com'|''|'Douglas'|'Ellmore'|'Lapsed'|'1998-01-01'
+3|'David  Forslund'|''|'Los Alamos National Lab'|''|''|''|''|''|''|'(505)-665-1907'|''|'dwf@acl.lanl.gov'|''|'David '|'Forslund'|'Customer'|'1998-04-01'
+4|'Mike  Mills'|'Director, Multimedia Technology'|'SoftCom'|'200 Middlesex Essex Turnpike, Suite 203'|''|'Iselin'|'NJ'|'08830'|''|'908/283-5900 x606'|'908/283-5757'|'ekim@softcom.com'|''|'Mike '|'Mills'|'Partner'|'1998-03-15'
+5|'Marvin  Scaff'|''|'Kinetoscope'|'7421 114th Ave. N.'|''|'Largo'|'FL'|'33773'|''|'813/541-0344'|'813/541-2360'|''|''|'Marvin '|'Scaff'|'Lapsed'|'1998-01-01'
+6|'George  Gombas'|'Principal'|'Npulse Software'|'2859 Shadow Creek Drive #306'|''|'Boulder'|'CO'|'80303-1755'|''|'303.818.7446'|'(303)-440-4224'|'gombas@ecentral.com'|''|'George '|'Gombas'|'Customer'|'1998-03-31'
+7|'Jim  Cribb'|''|'Penetics'|''|''|''|''|''|''|'(250)-338-4220'|''|'jim@penetics.com'|''|'Jim '|'Cribb'|'Lapsed'|'1998-01-01'
+8|'Richard Strong'|'Software Developer'|'Columbia University'|''|''|'New York '|'NY'|''|''|'212/543-5289'|''|'strongr@child.cpmc.columbia.edu'|'beta agreement 1/23/98'|'Richard'|'Strong'|'Customer'|'1998-03-01'
+9|'Dean DiSandro'|'President'|'Visionary Information Systems, Inc.'|'605 Hwy. 50, Suite 11'|''|'Zephyr Cove'|'CA'|'89448'|''|'714/536-9399'|''|''|''|'Dean'|'DiSandro'|'Evaluation'|'1997-12-04'
+10|'Carmela  Munson'|''|'Micro Computer Systems'|''|''|'Dallas'|'TX'|''|''|'972/659-1514'|''|'cgm@mcsdallas.com'|'www,mcsdallas.com'|'Carmela '|'Munson'|'Evaluation'|'1998-01-01'
+11|'Michael  Bisignani'|'V.P. Technology'|'Gemini Systems'|''|''|'New York'|'NY'|'10006'|''|'212/480-3960'|''|''|''|'Michael '|'Bisignani'|'Evaluation'|'1998-02-15'
+12|'Frank  Greco'|''|'Crossroads Technologies'|'55 Broad Street'|''|'New York'|'NY'|'10004'|''|'212/482-5280'|'212/482-5281'|'fgreco@crossroads-tech.com'|'http://www.crossroads-tech.com/'|'Frank '|'Greco'|'Evaluation'|'1998-01-01'
+13|'Dave Dewan'|'VP Product Strategy'|'Silverstream Software, Inc.'|'One Burlilngton Woods , Suite 200'|''|'Burlington'|'MA'|'01803'|''|'781/238-5459'|'781/238-5499'|''|''|'Dave'|'Dewan'|'Partner'|'1998-03-01'
+14|'Lindsey Williams'|'Chief Product Engineer'|'Rexton Interactive'|'24 Greenway Plaza, Suite 606'|''|'Houston'|'TX'|'77046'|''|'713/840-1224'|'713/840-1241'|'lwilliams@gorex.com'|''|'Lindsey'|'Williams'|'Evaluation'|'1998-02-01'
+15|'Lance Batten'|'President'|'Tilden Park'|'5237 College Avenue'|''|'Oakland'|'CA'|''|''|'510/283-5139'|''|'lance@tildenpark.com'|''|'Lance'|'Batten'|'Partner'|'1997-10-31'
+17|'Michael  Hickman'|'CTO'|'Blue Lobster Software'|'72 Cascade Drive'|''|'Rochester'|'NY'|'14614'|''|'716 546 3550'|'716.546.5488'|'Hickman@bluelobster.com'|''|'Michael '|'Hickman'|'Customer'|'1998-03-09'
+19|'Steven  Mann'|''|'Corel'|''|''|'Provo'|'UT'|''|'USA'|'801 765 4010  ext 73'|''|'smann@corel.com'|''|'Steven '|'Mann'|'Lapsed'|'1998-01-01'
+20|'Gary  Zakon'|'V.P. Engineering'|'Novera'|'3 Burlington Woods Drive'|''|'Burlington'|'MA'|'01803'|''|''|''|'Gary.Zakon@novera.com'|''|'Gary '|'Zakon'|'Lapsed'|'1998-02-01'
+21|'Jason  Maynard'|'VP Marketing'|'Verix Software'|'746 W. Adams Blvd., Suite 109'|''|'Los Angeles'|'CA'|'90089-7727'|''|'213/743-4226'|'213/749-7199'|'jmaynard@verix.com'|''|'Jason '|'Maynard'|'Lapsed'|'1998-01-01'
+23|'Chris  Herot'|'Director of Advanced Technology'|'Lotus'|''|''|''|''|''|''|'617/693-4026'|''|'herot@lotus.com'|''|'Chris '|'Herot'|'Lapsed'|'1998-01-01'
+25|'Valon  Cross'|'CTO'|'Background Profiles'|'145 Town and Country Drive, Suite 104'|''|'Danville'|'CA'|'94526'|''|'415/239-8950'|''|'spectrum@aimnet.com'|''|'Valon '|'Cross'|'Lapsed'|'1998-01-01'
+28|'William Coffin'|'Directory of Engineering'|'Weblogic'|'417 Montgomery Street'|''|'San Francisco'|'CA'|'94104'|''|'415-813-8030'|''|''|'http://www.weblogic.com'|'William'|'Coffin'|'Partner'|'1997-11-03'
+29|'Kia  Behnia'|''|'Marimba'|''|''|''|''|''|''|'(650) 930-5269'|''|''|''|'Kia '|'Behnia'|'Partner'|'1998-01-01'
+30|'J. R. Lowell'|'VP/CTO'|'MECA Software'|'115 Corporate Drive'|''|'Trumbull'|'CT'|'06611-1386'|''|'203 452 2750'|''|'jrlowell@mecasw.com'|''|'J. R.'|'Lowell'|'Customer'|'1998-03-11'
+33|'Timothy  Abels'|'Chief Technology Officer'|'Pervasive Software, Inc.'|'8834 Capitol of Texas Highway'|''|'Austin'|'TX'|'78759'|''|'512 794 1779'|'512.794.1778'|'tim.abels@pervasive.com      Charles Clendenen: cclenden@pervasive.com'|''|'Timothy '|'Abels'|'Evaluation'|'1998-02-01'
+35|'Carlos  Serrano-Morales'|'VP Software Architecture'|'Neuron Data'|'1310 Villa Street'|''|'Mountain View'|'CA'|'94041'|''|'650/528-3450'|'650/943-2752'|'carlos.serrano-morales@neurondata.com'|'http://www.neurondata.com'|'Carlos '|'Serrano-Morales'|'Partner'|'1998-01-27'
+36|'Don  MacDonald'|'Solution Architect'|'Tandem'|'19191 Vallco Parkway, Loc 4-60'|''|'Cupertino'|'CA'|'95014'|''|'408/285-5558'|'408/285-6132'|'macdonald_don@tandem.com'|''|'Don '|'MacDonald'|'Partner'|'1997-11-20'
+37|'Scott  Rozic'|''|'Verge Software Corporation'|'539 Bryant Street, Suite 304'|''|'San Francisco'|'CA'|'94107'|''|'415/538-1640'|'415/896-2561'|'scott@vergesoft.com'|'http://www.vergesoft.com'|'Scott '|'Rozic'|'Customer'|'1998-03-15'
+38|'Bob  Lee'|''|'Computer Curriculum Corporation'|''|''|'Santa Clara'|'CA'|''|''|'408 541 3285'|''|''|''|'Bob '|'Lee'|'Lapsed'|'1997-12-01'
+39|'Paul  Sholtz'|'Software Engineer'|'Omix'|'600 Allerton Street, Suite #202'|''|'Redwood City'|'CA'|'94063'|''|'650.482.2060'|''|'pjsholtz@omix.com'|'http://www.omix.com'|'Paul '|'Sholtz'|'Partner'|'1998-01-27'
+40|'Travis  Jensen'|'Software Engineer'|'Viewpoint Datalabs'|'625 South State Street'|''|'Orem'|'UT'|'84058'|'USA'|'801-229-3189'|'801-229-3300'|'travisj@viewpoint.com'|'http://www.viewpoint.com'|'Travis '|'Jensen'|'Customer'|'1998-04-01'
+42|'Sean Mickey'|'Consulting Manager'|'Noblestar'|'2070 ChainBridge Road, Suite 475'|''|'Vienna'|'VA'|'22182'|''|'703/641-8511'|'703/207-0324'|'smickey@noblestar.com'|'http://et.noblestar.com'|'Sean'|'Mickey'|'Evaluation'|'1998-01-01'
+43|'Nitin Borwankar'|'CEO and Chief Technology Officer'|'Borwankar Research'|'5543A Fremont Street'|''|'Oakland'|'CA'|'94608'|'U.S.A.'|'510-683-8394'|'510-653-8394'|'nitin@borwankar.com'|'beta agreement:  1/9/98'|'Nitin'|'Borwankar'|'Customer'|'1998-01-01'
+44|'David Brouse'|'Software Developer'|'Highmark, Inc.'|'1800 Center Street'|''|'Camp Hill'|'PA'|'17011'|''|''|''|''|''|'David'|'Brouse'|'Lapsed'|'1998-02-04'
+45|'Charles  Barbour'|'V.P. Product Development'|'Learncom'|'21860 Bear Creek Way'|''|'Los Gatos'|'CA'|'95030'|''|'408-873-3636'|'408-873-3645'|''|'http://www.learncom.com'|'Charles '|'Barbour'|'Lapsed'|'1998-01-01'
+46|'Daniel MacDonald'|'Engineer'|'Molecular Simulations'|'9685 Scranton Road'|''|'San Diego'|'CA'|'92121'|''|'619/458-9990'|'619/458-0136'|'dwm@msi.com'|'http://www.msi.com'|'Daniel'|'MacDonald'|'Evaluation'|'1998-01-01'
+47|'Patrick Vermont'|'Director, Product Management'|'Progress Software'|''|''|''|''|''|''|''|''|''|''|'Patrick'|'Vermont'|'Lapsed'|'1998-02-01'
+48|'Anthony Bell'|'CEO'|'Skunk Technologies'|''|''|'Santa Monica'|'CA'|''|''|''|''|''|''|'Anthony'|'Bell'|'Evaluation'|'1998-01-01'
+49|'Warren Reavis'|'Senior Software Engineer'|'Sterling Software'|'MS 229-4'|''|'Moffett Field'|'CA'|'94035-1000'|''|'650/604-3931'|'650/604-5244'|'reavis@nas.nasa.gov'|''|'Warren'|'Reavis'|'Lapsed'|'1998-01-01'
+50|'Lewis Tucker'|'Director, Developer Relations'|'Sun Microsystems'|''|''|'Palo Alto'|'CA'|''|''|''|''|''|''|'Lewis'|'Tucker'|'Partner'|'1998-02-04'
+51|'Ward Mullins'|'President'|'Thought, Inc.'|'57 Mission St., Suite 202'|''|'San Francisco'|'CA'|'94105'|''|'415/836-9199'|'415/836-9191'|'ward@thoughtinc.com'|'http://www.thoughtinc.com'|'Ward'|'Mullins'|'Partner'|'1997-11-06'
+52|'Bill  Li'|'Director, Engineering'|'Internet Image'|'39560 Stevenson Pl'|'Suite 119'|'Fremont'|'CA'|'94539'|''|'510 739 2030 x113'|'510 739 0703'|'bill@internetimage.com'|'www.internetimage.com'|'Bill '|'Li'|'Partner'|'1998-02-05'
+53|'Karen Watterson '|''|'Database Advisor Magazine'|'8361 Capricorn Way, #22'|''|'San Diego'|'CA'|'92126'|''|'619-271-5090'|''|'karen_watterson@email.msn.com'|''|'Karen Watterson'|''|'Reviewer'|'1998-02-05'
+54|'Kevin Gartner'|''|'Rogue Wave'|''|''|''|''|''|''|'541/754-4091'|''|'keving@roguewave.com '|''|'Kevin'|'Gartner'|'Lapsed'|'1998-01-01'
+56|'Ben Mesander'|'Senior Consultant'|'Creative Concepts Corporation'|'4949 Pearl East Circle, Suite 200'|''|'Boulder'|'CO'|'80301'|''|'303-448-0303'|'303-448-0205'|'ben@creativecorp.com'|'http://www.creativecorp.com'|'Ben'|'Mesander'|'Lapsed'|'1998-02-10'
+57|'Michael Berg'|'Senior Systems Programmer'|'Visa International'|'Post Office Box 8999, M/S M1-6F'|''|'San Francisco'|'CA'|'94128-8999'|''|'650-432-7013'|'650-432-3199'|'mberg@visa.com'|'http://www.visa.com'|'Michael'|'Berg'|'Customer'|'1998-03-05'
+58|'Greg Smith'|'President'|'Object Systems, Inc.'|'3196 Fiery Run Road'|''|'Linden'|'VA'|'22642'|''|'540-364-3341'|'540-364-3885'|'greg.smith@objectsystemsinc.com'|'http://www.objectsystemsinc.com'|'Greg'|'Smith'|'Customer'|'1998-03-01'
+59|'Mike Stevens'|'Principal'|'Dynavent Software'|'125 South Wacker Drive,'|''|'Chicago'|'IL'|'60606'|''|'312-920-6337'|'312-214-2510'|'stevens@dynavent.com'|'http://www.dynavent.com'|'Mike'|'Stevens'|'Lapsed'|'1998-03-01'
+60|'Edward Archibald'|'Principal'|'Telecallaction'|'Post Office BOx'|''|'Mendecino'|'CA'|'95460'|''|'707-937-2976'|'707-937-2957'|'edward@mcn.org'|''|'Edward'|'Archibald'|'Lapsed'|'1998-03-10'
+61|'Edward Langford'|'Principal'|'Cybered Corp'|''|''|'Virginia Beach'|'VA'|''|''|'757-467-3322'|''|'cybered@cyberglide.net'|''|'Edward'|'Langford'|'Lapsed'|'1998-03-01'
+62|'Peter Heirendt'|'Project Manager'|'ADC Kentrox'|'14735 N.W. Science Park Drive'|''|'Portland'|'OR'|'97229'|''|'503-643-1681'|'503-641-3321'|'heirendt@kentrox.com'|'http://www.kentrox.com'|'Peter'|'Heirendt'|'Evaluation'|'1998-03-01'
+63|'Daniel Ellison'|'Project Manager'|'Sprocket Interactive Solutions '|'10 Alcorn, Suite 301'|''|'Toronto'|'ON'|'M4V 3A9'|''|'416-962-1809'|'416-962-0619'|''|''|'Daniel'|'Ellison'|'Evaluation'|'1998-03-05'
+64|'Kenneth L. Greenlee'|'Principal'|'Kenetiks, Inc.'|''|''|'Raleigh'|'NC'|''|''|''|'919-781-0386'|''|''|'Kenneth L.'|'Greenlee'|'Evaluation'|'1998-02-24'
+65|'Jia-Bao Chu'|'CTO'|'Infospace, Inc.'|'3130 La Selva, Suite 300'|''|'San Mateo'|'CA'|'94403'|''|'650/655-3934'|'650/655-6750'|''|''|'Jia-Bao'|'Chu'|'Lapsed'|'1998-03-15'
+66|'William  Lyon'|'Senior Product Mgr.'|'Open Horizon'|'501 Gateway Blvd., Suite 800'|''|'South San Francisco'|'CA'|'94080'|''|'650/869-2200'|'650-869-2201'|''|''|'William '|'Lyon'|'Lapsed'|'1998-03-12'
+67|'Stewart Allen'|'V.P. Engineering'|'WebMethods, Inc.'|'3975 University Drive, Suite 360'|''|'Fairfax'|'VA'|'22030'|''|'703-352-8501'|'703-352-0370'|''|''|'Stewart'|'Allen'|'Customer'|'1998-03-12'
+68|'Peter Wilkinson'|''|'Sovereign Bank'|''|''|''|''|''|''|'860/986-2379'|''|''|''|'Peter'|'Wilkinson'|'Evaluation'|'1998-03-10'
+69|'Greg Sabatino'|'Principal'|'NetNumina Solutions'|'529 Main St., # 222'|''|'Boston'|'MA'|'02129'|''|'617/242-0925, x236'|'617/242-0430'|''|''|'Greg'|'Sabatino'|'Customer'|'1998-03-06'
+70|'C. Reid Flinn'|''|'Interactive Education'|'P.O. Box 13662'|''|'Richmond'|'VA'|'23225-8662'|''|'804/231-1130'|'804/231-0167'|'cflinn@neweducation.com'|'                                                                                                    '|'C. Reid'|'Flinn'|'Customer'|'1998-03-04'
+71|'Steve Pringle'|'Principal'|'LiveMedia'|'5174 Miles Avenue'|''|'Oakland'|'CA'|'94618-1088'|''|'510/601-9879'|'510/339-6278'|'pringle@livemedia.com'|''|'Steve'|'Pringle'|'Customer'|'1998-03-06'
+72|'Daniel Baskette'|'Systems Engineer'|'Sun Microsystems'|'3655 North Point Parkway, Suite 600'|''|'Alphretta'|'GA'|'30005'|''|'770-360-6436'|'770-360-6410'|'Dan.Baskette@East.Sun.COM'|'http://www.sun.com'|'Daniel'|'Baskette'|'Partner'|'1998-03-19'
+73|'Wayne Duquaine'|'Software Engineer'|'Grandview DB/DC Systems'|'10777 Cherry Ridge Road'|''|'Sebastopol'|'CA'|'95472'|''|'707-829-9633'|'707-829-7264'|'grandview@sonic.net'|''|'Wayne'|'Duquaine'|'Evaluation'|'1998-03-20'
+74|'Terence John Parr'|'President'|'Mage Lang Institute, Ltd.'|'1535 Francisco Street'|'suite 9'|'San Francisco'|'CA'|'94123'|''|'415-346-1070'|'415-563-4215'|'parrt@MageLang.com'|'www.jguru.com/parrt'|'Terence John'|'Parr'|'Evaluation'|'1998-03-31'
+75|'Craig Newmark'|'President'|'List Foundation'|'1010 Cole'|''|'San Francisco'|'Ca'|'94117'|''|'415.753.6394'|''|'craig@cnewmark.com'|'http://www.listfoundation.org'|'Craig'|'Newmark'|'Evaluation'|'1998-04-01'
+76|'Doron Gan'|'President'|'Shafir Inc.'|'11409 D K Ranch Road'|''|'Austin'|'Tx'|'78759'|''|'512.257.7260'|'512.378.3330'|'dgan@shafir.com'|'http://www.shafir.com'|'Doron'|'Gan'|'Evaluation'|'1998-04-01'
+77|'Mark  Ashworth'|'Owner'|'Great Northwest Design'|'619 12th'|''|'Bellingham'|'WA'|'98225'|''|'360/733-2802'|'360/738-0377'|'MARK@PLANDS.COM'|''|'Mark '|'Ashworth'|'Customer'|'1998-03-31'
+78|'Scott K. McMullan'|'President '|'Inovie Software Inc.'|''|''|''|''|''|''|'619.296.5548'|''|''|''|'Scott K.'|'McMullan'|'Customer'|'1996-01-08'
+79|'Paul  Czarnik'|'VP Development'|'LANQUEST'|'47800 Westinghouse Drive'|''|'Fremont'|'CA'|'94539'|''|'510.354.0940'|'510.354.0950'|''|''|'Paul '|'Czarnik'|'Customer'|'1998-01-04'
+80|'Russ Bartels'|'Project Executive'|'Hitachi'|'452 Fifth Avenue'|''|'New York City'|'NY'|'10018'|'USA'|'2128271346'|'2123820576'|'russ.bartels@hds.com'|'http://www.hds.com'|'Russ'|'Bartels'|'Customer'|'1998-03-31'
+81|'Steve Davidson'|'Senior Consultant'|'Sprint Paranet'|'535 Anton Blvd Ste 1100'|'1-800-255-8188 pin 74816'|'Costa Mesa'|'CA'|'92626'|''|'714.541.9737 ext.4316'|''|'srdavids@sprintparanet.com'|'http://www.sprintparanet.com'|'Steve'|'Davidson'|'Evaluation'|'1998-04-03'
+82|'Alan Slater'|'CTO'|'Orbital Technologies'|'90 Corbiehill Cresent'|''|'Edinburgh'|''|'EH4 5G'|''|' 44 (0) 131.538.8850'|' 44 (0) 131.538.8851'|'info@orbital.tech.com'|'www.orbital.tech.com'|'Alan'|'Slater'|'Evaluation'|'1998-04-06'
+83|'Jan Mazac'|'President'|'Biss GmbH'|'Chaukenweg 12'|''|'Wilhelmshaven'|''|'D-26388'|''|'04423/9289-0'|'04423/9289-99'|'jwm@biss-net.com'|''|'Jan'|'Mazac'|'Customer'|'1998-04-05'
+84|'Michael J. Murphy'|'Program Manager'|'GRC International, Inc.'|'1900 Gallows Road'|''|'Vienna'|'VA'|'22182'|''|'703.506.5000'|'703.506.1757'|'mmurphay@grci.com'|''|'Michael J.'|'Murphy'|'Evaluation'|'1998-04-06'
+85|'Jon Christensen'|''|'Painted Word, Inc.'|'124 Mt. Auburn St.'|''|'Cambridge'|'MA'|'02138'|''|'617.349.0050'|'617.349.0070'|'jmc@paintedword.com'|''|'Jon'|'Christensen'|'Evaluation'|'1998-04-03'
+86|'Mustafa Syed'|'CTO'|'Isadra, Inc.'|'1000 Elwell Court Suite 230'|''|'Palo Alto'|'CA'|'94303'|''|'650.691.1100'|'650.962.5390'|'msyed@isadra.com'|'http://www.isadra.com'|'Mustafa'|'Syed'|'Customer'|'1998-04-03'
+87|'Tim Moses'|'Technical Manager'|'Delphi Solutions'|''|''|'Sereitubach'|''|'CH-8957'|'Switzerland'|''|''|''|''|'Tim'|'Moses'|'Customer'|'1998-04-07'
+88|'Adrian Brown'|'VP,Technical Development'|'FieldWorker Products Ltd.'|'1477 Bayview Ave.  Suite H6'|''|'Toranto Ontario'|'Canada'|'M4G 3B2'|''|' 1 416.483.3485'|' 1 416.483.7069'|'adrian@fieldworker.com'|'http://www.fieldworker.com'|'Adrian'|'Brown'|'Evaluation'|'1998-04-06'
+89|'Brent Johnston'|'Software Designer'|'Fiberlane Communications Canada, Inc.'|'108-8988 Fraserton Court'|''|'Burnaby'|'BC'|'V5J 5H8'|'CANADA'|'604.433.0597'|'604.433.0257'|'brent@Fiberlane.com'|'http://www.fiberlane.com'|'Brent'|'Johnston'|'Lapsed'|'1998-04-07'
+90|'Peter  Brown'|'Director Srategic Relations'|'Novell'|'1555 N. Technology Way                    '|'mail stop:  E-331'|'Oreum'|'UT'|'84097-2399'|''|'801.222.5510'|'801.228.5070'|'pbrown@novell.com'|'www.novell.com'|'Peter '|'Brown'|'Evaluation'|'1998-04-07'
+91|'Scott R. Anderson'|''|'Platinum technology, Inc. ViaTech Development Lab '|'2600 Eagan Woods Drive'|'Suite 410'|'Eagan'|'MN'|'55121'|''|'612.688.3033'|'612.688.3113'|''|''|'Scott R.'|'Anderson'|'Evaluation'|'1998-04-08'
+92|'Nicolas Dewaele'|'Consultant'|'IBM'|'23 Rte des Chevalius de Malte, 1228 PLO'|''|'Geneva'|''|'2W2 w2'|'Switzerland'|'22.918.4589'|'22.918.4200'|'chibmz2m@ibmmail.com'|''|'Nicolas'|'Dewaele'|'Customer'|'1998-04-08'
+93|'Zeez Rozov'|'Executive Director'|'Manna Network Technologies'|'4 Harechev St.'|'PO Box 57610'|'Tel-Aviv'|''|'61574'|'Israel'|'972.3.6880855'|'972.3.6880455'|''|''|'Zeez'|'Rozov'|'Customer'|'1998-04-08'
+94|'Ed M. Tighe                                             '|'President'|'Advanced Workstation Solutions, Inc.'|'4166 Harvestwood'|''|'Grapevine'|'TX'|'96051'|''|'817.267.0061'|'817.267.7625'|''|''|'Ed M.'|'Tighe                                             '|'Customer'|'1998-04-08'
+95|'Savio Lam'|''|'Cybotics Technologies Ltd.'|'3A, 221 Sai Yeung Choi Street'|''|'Kowloon'|''|''|'Hong Kong'|'852.9260.8649'|''|'admin@cybotics.com'|''|'Savio'|'Lam'|'Evaluation'|'1998-04-09'
+96|'James P. Barber'|'Internet Systems Analyst'|'Intermedia Communications, Inc.'|'3625 Queen Palm Drive'|'Sabal Building 8'|'Tampa'|'FL'|'33619'|''|'1800.940.0011'|''|'jpbarber@intermedia.com'|'http://www.intermedia.com'|'James P.'|'Barber'|'Evaluation'|'1998-04-09'
+97|'Vasu Muppalla'|'Software Engineer'|'Bay Networks, Inc.'|'4915 Waters Edge Drive'|'Suite 200'|'Raleigh'|'NC'|'27606'|''|'919.859.5200 x100'|'919.859.0515'|'vmuppalla@baynetworks.com'|''|'Vasu'|'Muppalla'|'Evaluation'|'1998-04-14'
+98|'Brad  Miller'|'Principal'|'Charles River Associates, Inc.'|'200 Clarendon Street'|'John Hancock Tower T-33'|'Boston'|'MA'|'02116'|''|'617.425.3000'|'617.425.3132'|''|''|'Brad '|'Miller'|'Customer'|'1998-04-14'
+99|'Savvas Xenophontos'|''|'Scopus Technologies'|'1900 Powell Street'|''|'Emeryville'|'CA'|'94608'|''|'510.597.5800'|'510.597.8787'|'sxenophontos@scopus.com'|'http://www.scopus.com'|'Savvas'|'Xenophontos'|'Evaluation'|'1998-04-14'
+110|'Peter Yared'|''|'Net Dynamics'|'185 Constitution Drive'|''|'Menlo Park'|'CA'|'94025'|'US'|'650.462.7600'|'650.617.5920'|''|''|'Peter'|'Yared'|'Evaluation'|'1998-04-23'
+111|'Jim  Longson'|''|'Tomday'|'6965 El Camino Real, #105-696'|''|'Carlsbad'|'CA'|'92009'|'US'|''|'800.511.2419'|'jiml@longson.com'|''|'Jim '|'Longson'|'Customer'|'1998-03-27'
+113|'Mike Kilgore'|''|'Cerulean Technology, Inc.'|'300 Nickerson Road'|''|'Marlborough'|'MA'|'01752-4694'|''|'508.460.4000'|'508.460.4099'|'mkilgore@cerulean.com'|''|'Mike'|'Kilgore'|'Evaluation'|'1998-04-29'
+114|'Evan Maloney'|''|'Pencom Web Works'|'40 Fulton Street'|''|'New York'|'NY'|'10128'|''|'212.513.7777'|'212.513.1014'|'evan@metaphoria.net'|''|'Evan'|'Maloney'|'Evaluation'|'1998-04-29'
+115|'Bhavini Subramani'|''|'Check Free'|'5655 Spaulding Drive'|''|'Norcross'|'GA'|'30092'|''|'770.734.3926'|'770.734.3124'|'bhavini_subramani@atl.checkfree.com'|''|'Bhavini'|'Subramani'|'Evaluation'|'1998-04-29'
+116|'Brian Houston'|'Senior Systems Analyst'|'Vestek Systems'|'388 Market Street, Suite 700'|''|'San Francisco'|'Ca'|'94111'|'U.S.A.'|'415.398.6340'|'415.392.6831'|'brian@vestec.com'|'http://www.vestec.com'|'Brian'|'Houston'|'Customer'|'1998-04-28'
+117|'Jack Hakim'|'CEO'|'EC Wise, Inc'|'450 East Strawberry Drive'|''|'Mill Valley'|'CA'|'94941'|'U.S.A.'|'415. 383.8051'|'415.383.8059'|'jack@ecwise.com'|'http://www.ecwise.com'|'Jack'|'Hakim'|'Customer'|'1998-04-28'
+118|'Ed Langhall'|''|'Cybered Corp.'|'1152 Eppington Drive'|''|'Virgina Beach'|'VA'|'23454'|''|'757.925.5508 or it is same as fax'|'.427.3322'|'cybered@cyberglide.net'|''|'Ed'|'Langhall'|'Customer'|'1998-04-30'
+119|'Lorne Levinson'|''|'The Weizmann Institute of Science'|'Rehovot Post Office Box 26'|''|'Rehovot'|''|'78100'|'Israel'|'08.9344080'|'972.8.9344101'|'fhlevins@wicc.weizmann.ac.il'|''|'Lorne'|'Levinson'|'Customer'|'1998-04-30'
+120|'Cary Knoop'|''|'Acutate Software'|'999 Baker Way'|''|'San Mateo'|'CA'|'94404'|'U.S.A.'|'650.425.2300'|''|'cknoop@acutate.com'|''|'Cary'|'Knoop'|'Evaluation'|'1998-04-30'
+121|'Brian Frank'|'Database Developer'|'Tridium, Inc.'|'4880 Cox Road '|'Suite 104'|'Glen Allen'|'VA'|'23060'|''|'804.747.4771'|'804.747.5204'|'brian@tridium.com'|'www.tridium.coom'|'Brian'|'Frank'|'Lapsed'|'1998-05-02'
+122|'Umashankar Sathyanarayana'|'Application Consultant'|'Dun and Bradstreet'|'3 Sylvan Way'|''|'Parsippany'|'NJ'|'7054'|'U.S.A.'|'973.605.6532'|''|'sathayanar@mail.dnb.com'|''|'Umashankar'|'Sathyanarayana'|'Evaluation'|'1998-05-02'
+123|'Chris Economy'|'DBA/Consulting Systems Engineer'|'Bank of America'|''|''|'Concord'|'CA'|''|'U.S.A.'|'510.675.4090'|''|'faith.economy@bankamerica.com'|''|'Chris'|'Economy'|'Customer'|'1998-05-01'
+124|'Tomoko Yamaguchi'|'Manager'|'Omron Corporation'|''|''|'Kyoto'|''|''|'Japan'|'81-75-957-9816'|''|'tomoko.yamguchi@omron.co.jp'|''|'Tomoko'|'Yamaguchi'|'Customer'|'1998-05-01'
+125|'Bjorn Buensuceso'|'College Student'|'Mission Campus CCSF'|''|''|'San Francisco'|'CA'|''|'U.S.A.'|''|''|'bjorn_31@hotmail.com'|''|'Bjorn'|'Buensuceso'|'Customer'|'1998-05-01'
+126|'John Pommier'|'Lecturer'|'SFSU'|''|''|'San Francisco'|'CA'|''|'U.S.A.'|'415.338.1600'|''|'jpommier@stars.sfsu.edu'|''|'John'|'Pommier'|'Customer'|'1998-05-01'
+127|'Nobuhiko Nagamori'|'President, CEO'|'Nob Systems Corp.'|''|''|''|''|''|''|''|''|'setgraph@eka.att.nz.jp'|''|'Nobuhiko'|'Nagamori'|'Customer'|'1998-05-01'
+128|'B. Hoh'|'Developer'|'Impact'|''|''|''|'CA'|''|'U.S.A.'|'510.839.3684'|''|'bevhoh@hotmail.com'|''|'B.'|'Hoh'|'Customer'|'1998-05-01'
+129|'Andreas Dieckow'|'Product Manager'|'Cache InterSytems'|'One Memorial Drive'|''|'Cambridge'|'MA'|'02142'|'U.S.A.'|'617.621.0600'|'617.494.1631'|'andreas@intersys.com'|'www.intersys.com'|'Andreas'|'Dieckow'|'Customer'|'1998-05-01'
+130|'George Head'|'Director'|'Minddale'|'216 West 64th Place'|''|'Inglewood'|'CA'|'90302'|'U.S.A.'|'310.412.2368'|'310.412.7088'|'ghead@fuser.com'|''|'George'|'Head'|'Customer'|'1998-05-01'
+131|'Vinay Sabharwal'|'Principal'|'V.S. '|'null'|''|''|'CA'|''|'U.S.A.'|'510.490.3666'|''|'vxs@home.com'|''|'Vinay'|'Sabharwal'|'Customer'|'1998-05-01'
+132|'Michael Connor'|'Sr. Software Engineer'|'Answer Soft Corp.'|''|''|''|'CA'|''|'U.S.A.'|'408.253.7515'|''|'mconnor@answerftwr.com'|''|'Michael'|'Connor'|'Customer'|'1998-05-01'
+133|'Jose Ignacio Uribe'|'Finance Director'|'Software Tecnologia Y Servicios S.A.'|'Carrera 15 No. 92-70 Of.:302'|''|'Santafe de Bogota'|'D.C.'|''|'Colombia'|'6104489'|'2573426'|''|''|'Jose Ignacio'|'Uribe'|'Customer'|'1998-05-01'
+134|'Mike Davis'|''|'IBM'|''|''|''|''|''|''|''|'512.838.9813'|''|''|'Mike'|'Davis'|'Evaluation'|'1998-05-15'
+135|'James Patterson'|''|'Management Sciences'|'565 Penn Avenue'|''|'Philidelphia'|'PA'|'15206'|'USA'|'(800) 672.4636 x1947'|'(412) 363.1375'|'jpatterson@msa.com'|''|'James'|'Patterson'|'Evaluation'|'1998-05-18'
+136|'Ronnie Thomson'|''|'Centra Software'|'430 Bedford Street'|''|'Lexington'|'MA'|'02173'|'USA'|'781.994.1027'|'781.863.7288'|'rthomson@centra.com'|''|'Ronnie'|'Thomson'|'Evaluation'|'1998-05-18'
+137|'Ken  Horowitz'|''|'Ergo tech'|'35 East 21st St.'|''|'New York'|'NY'|'10010'|'USA'|'212.741.1720'|''|'kenh@ergo-tech.com'|''|'Ken '|'Horowitz'|'Evaluation'|'1998-05-18'
+138|'Dave  Brouse'|''|'Highmark'|'150  Corporate Center Drive'|'Suite#200'|'Camp Hill'|'PA'|'17011'|'USA'|'717.731.8053'|'717.730.8968'|'dbrouse@highmark.com'|''|'Dave '|'Brouse'|'Evaluation'|'1998-05-08'
+139|'Janos Mucsi'|''|'Dig itsoft'|'369 Lexington Avenue'|''|'New York'|'NY'|'10017'|'USA'|'212.687.1810'|'212.687.1781'|'mucsij@ibm.net'|''|'Janos'|'Mucsi'|'Evaluation'|'1998-05-08'
+140|'Dennis Dennunzio'|''|'Sunbelt Business Brokers Network'|'2 Amherst St.'|''|'Charleston'|'SC'|'29403'|'USA'|'843.853.4781 x21'|'843.853.4133'|'dbd@sunbeltnetwork.com'|''|'Dennis'|'Dennunzio'|'Evaluation'|'1998-05-12'
+141|'Richard Gunn'|''|'Gunn Software Pty Ltd.'|'5/40 Old Barrenjoey  Road'|''|'Avalon'|'NSW'|'2107'|'Australia'|'01161299183666'|'01161299187388'|'rgunn@gunnsoft.com.au'|''|'Richard'|'Gunn'|'Customer'|'1998-05-18'
+142|'Kelby Zordrager'|''|'Sun Microsystems Educational Services'|'Rosslyn Center'|'1300 Wilson Bouleveard'|'Arlington'|'VA'|'22209'|'USA'|'703.248.2175'|'703.294.'|'kelby.zorgdrager@east.sun.com'|''|'Kelby'|'Zordrager'|'Partner'|'1998-05-07'
+143|'Pamela Niedgrmayer'|''|'Pinehill Softworks'|'301 Main Street'|''|'Falmouth'|'MA'|'02540'|'USA'|'508.548.4470'|'508.548.8731'|''|''|'Pamela'|'Niedgrmayer'|'Customer'|'1998-05-18'
+144|'Joseph Molnar'|''|'en Vise Corporation'|'20 Toronto Street'|'Suiute 520'|'Toronto'|'Ontario'|''|'Canada'|'416.777.1697'|'416.368.3086'|''|''|'Joseph'|'Molnar'|'Evaluation'|'1998-05-20'
+145|'Gerald Canfield'|'Professor'|'University of Maryland, UMBC'|'1000 Hilltop Circle/ACIV BLDG'|''|' Baltimore'|'MD'|'21250 '|'US'|'410-455-2649'|''|'canfield@umbc.edu'|''|'Gerald'|'Canfield'|'Customer'|'1998-05-19'
+146|'Jonathan Brown'|'President'|'Temple Games, Inc.'|'59 Wingate Road'|''|'South Kingstown'|'RI'|'02879 '|'US'|'401-272-7325'|''|'jbrown@templegames.com'|''|'Jonathan'|'Brown'|'Customer'|'1998-05-19'
+147|'Anne  Troop'|''|'Hewlett-Packard NJ Labs'|'300 campus Drive'|''|'Florham Park'|'NJ'|'07932'|'USA'|'973.443.7539'|''|'amt@fpk.hp.com'|''|'Anne '|'Troop'|'Evaluation'|'1998-05-21'
+148|'Richard Hoad'|'Developer'|'Food and Agriculture Organization'|''|''|'Rome'|''|''|'Italy'|''|''|'Richard.Hoad@fao.org'|'http://www.fao.org'|'Richard'|'Hoad'|'Customer'|'1998-05-26'
+149|'James Sangroniz'|''|'Hewlett-Packard'|'11311 Chinden Blvd, MS-133'|''|'Boise'|'ID'|'83714-0021'|'USA'|'208.396.4067'|'208.396.3457'|'james_sangroniz@hp.com'|''|'James'|'Sangroniz'|'Evaluation'|'1998-05-26'
+150|'Andrew  Scherpbier'|'VP of  Engineering'|'Contigo Software'|'8334 Clairemont Mesa Blvd.'|'Suite 204'|'San Diego'|'CA'|'92111'|'USA'|'619.278.5900'|'619.292.1454'|'andrew@contigo.com'|'www.contigo.com'|'Andrew '|'Scherpbier'|'Evaluation'|'1998-05-27'
+151|'Andrew  Sodt'|'Architect'|'Adobe Systems'|'2712 48th AVE SW'|''|'Seattle'|'WA'|'98116'|'US'|'206 470 7538'|''|'asodt@adobe.com'|''|'Andrew '|'Sodt'|'Customer'|'1998-05-23'
+152|'Martin  Higham'|''|'Trefoil Computers Ltd'|'9 Tangley Drive'|''|'Wokingham'|'Berkshire '|'RG41 2PD '|'UK'|'44 118 978 0331'|''|'martin@trefoil.demon.co.uk'|''|'Martin '|'Higham'|'Customer'|'1998-05-25'
+153|'Franz  H�rmann'|'Prof.Dr.'|'University of Economics'|'Apfelgasse 48'|''|' St. Andr�/W�rdern'|'Nieder�sterreich '|'A-3423 '|'AT'|'011-431-313-36-4680'|''|'franz.hoermann@wu-wien.ac.at'|''|'Franz '|'H�rmann'|'Customer'|'1998-05-27'
+154|'Arne Wilhelmsen'|''|'Seven Moutains'|'1450 Fashion Island Blvd.'|'Ste. 680'|'San Mateo'|'CA'|'94404'|'USA'|'650.574.5023'|''|'arne@sevenmountains.com'|''|'Arne'|'Wilhelmsen'|'Evaluation'|'1998-05-29'
+155|'Danny Pearce'|'V.P. Development'|'Computing Concepts'|'27888 Burrough North Road'|''|'Tollhouse'|'CA'|'93667'|'U.S.A.'|'209-855-2014'|''|'danny@computing-concepts.com'|'http://www.computing-concepts.com'|'Danny'|'Pearce'|'Customer'|'1998-06-01'
+156|'Rob ten Kroode'|''|'Acriter Systems BV'|'Pelmolen 20'|''|'Houten'|''|'3994 XZ'|'Netherlands'|'( 31) 30 6344010'|'( 31) 30 6344011'|''|''|'Rob ten'|'Kroode'|'Evaluation'|'1998-05-22'
+157|'Roman Stanek'|'Founder/CEO'|'NetBeans, Inc.'|''|''|''|''|''|''|' 420 2 83 007 321'|' 420 2 83 007 399'|'roman.stanek@netbeans.com'|''|'Roman'|'Stanek'|'Evaluation'|'1998-06-03'
+158|'Tony Curwen'|''|'Ingram Micro Inc.'|'1600 E. St. Andrews Place  P.O. Box 25'|''|'Santa Ana'|'CA'|'92799-5125'|'USA'|'714.566.1000 x23337'|'714.566.7830'|'tony.curwen@ingrammicro.com'|''|'Tony'|'Curwen'|'Evaluation'|'1998-06-04'
+159|'John Justin Hough'|'Sr. Mgr. Software Engineer'|'Southwestern Bell Messaging Services, Inc.'|'4801 NW Loop>410, >Suite 850'|''|'San Antonio'|'TX'|'78229'|'USA'|'210.523.4362'|'210.523.4396'|'jh1331@txmail.sbc.com'|''|'John Justin'|'Hough'|'Customer'|'1998-06-05'
+160|'Matt Cooper'|''|'Sienco, Inc.'|'4892 Van Gordon Street, Unit 203'|''|'Wheat Ridge'|'CO'|'80033'|'USA'|'303.420.1148'|'303.420.2204'|'mcooper@mines.edu'|''|'Matt'|'Cooper'|'Evaluation'|'1998-06-05'
+161|'David  Warnock'|''|'Sundayta Ltd'|'27 Herrick Close'|''|'Crawley'|''|'RH103AN'|'United Kingdom'|''|''|'david@sundayta.co.uk'|''|'David '|'Warnock'|'Evaluation'|'1998-06-05'
+162|'Paul Smith'|'Development Manager'|'Dell Computer'|''|''|'Austin'|'TX'|''|'USA'|''|''|'Paul_T_Smith@dell.com'|'http://www.dell.com'|'Paul'|'Smith'|'Customer'|'1998-06-05'
+163|'Christian Trahan'|'Developer'|'VerticalSoftware.com'|''|''|'Mountain View'|'CA'|''|'USA'|''|''|'ctrahan@verticalsoftware.com'|'http://www.verticalsoftware.com'|'Christian'|'Trahan'|'Customer'|'1998-06-05'
+164|'Eddy Belefdil'|'Director'|'Synthese S.A.'|'76, Route de Saint Julien '|''|'Grand-Lancy'|''|'1212'|''|'(4122) 827.40.20'|'(4122) 827.40.25'|''|''|'Eddy'|'Belefdil'|'Customer'|'1998-06-08'
+165|'Jerry  Presley'|'Vice PResident'|'Micro Computer Systems, Inc.'|'2300 Valley View Lane'|'Suite 800'|'Irving'|'TX'|'75062'|'USA'|'972.659.1514'|'972.659.1624'|'jerryp@mcsdallas.com'|'www.mcsdallas.com'|'Jerry '|'Presley'|'Customer'|'1998-06-08'
+166|'Tony Pujals'|''|'ObjectMedia, Inc.'|'1400 Coleman Avenue, Suite A21'|''|'Santa Clara'|'CA'|'95050'|'USA'|'408.235.8700 x101'|'408.235.8774'|'tony@objectmedia.com'|'www.objectmedia.com'|'Tony'|'Pujals'|'Evaluation'|'1998-06-08'

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere2.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere2.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/ImportExport/sqlAnywhere2.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,204 @@
+42|20|'Jeffrey'|'Anuszczyk'|'(781)270-4422, ext 208'||'jeffa@novera.com'
+43|14|'Robert '|'Dragotta'|'713/840-1224'|'713/840-1241'|'robert.dragotta@gorex.com'
+44|29|'Brigham'|'Stevens'|''|''|'brigham@marimba.com'
+45|15|'Robert'|'Hodges'|''|''|'hodges@tildenpark.com'
+46|9|'Jeff'|'Johnson'|''|''|'jdjohnson@fea.net'
+47|23|'Rich'|'Reily'|''|''|'Rich_Reily@lotus.com'
+48|30|'Paul'|'Swigert'|'203/452-2705'|''|'swigert@mecasw.com'
+49|17|'Joe'|'Marchese'|'716 546 3550'|''|'joe@bluelobster.com'
+50|33|'Rob'|'Adams'|'512 794 1463'|''|'radams@pervasive.com'
+51|33|'Tim '|'Abels'|'512 794 1581'|''|'tabels@pervasive.com'
+52|19|'Dave'|'Summers'|'801/765-4010, ext. 70'|''|'daves@corel.com'
+53|23|'Alex'|'Morrow'|'617 693 5407'|''|'Alex_Morrow@lotus.com'
+54|46|'Bob'|'Goodfliesh'|'619/546-5301'|''|'bgood@msi.com'
+55|46|'Maurice'|'Manning'|'619/799-5316'|''|'mmanning@msi.com'
+56|11|'Salina'|'Cheung'|''|''|'scheung@gemini-systems.com'
+57|10|'Dennis'|'Esters'|'972/659-1514'|''|'de@mcsdallas.com'
+70|57|'Michael'|'Berg'|'650-432-7013'|'650-432-3199'|'mberg@visa.com'
+133|103|'Gary'|'Zalcon'|''|''|''
+1|1|'Peter '|'Cipollone'|'(609)-520-7754'|''|'peterc@wsj.dowjones.com'
+2|2|'Bob '|'Huff'|'(703)-742-3308'|''|'bhuff@elpress.com'
+3|3|'David '|'Forslund'|'(505)-665-1907'|''|'dwf@acl.lanl.gov'
+4|4|'Mike '|'Mills'|'908/283-5900 x606'|'908/283-5757'|'ekim@softcom.com'
+5|5|'Marvin '|'Scaff'|'813/541-0344'|'813/541-2360'|''
+6|6|'George '|'Gombas'|'(303)-440-4224'|''|'gombas@ecentral.com'
+7|7|'Jim '|'Cribb'|'(250)-338-4220'|''|'jim@penetics.com'
+8|8|'Richard'|'Strong'|'212/543-5289'|''|'strongr@child.cpmc.columbia.edu'
+9|9|'Dean'|'DiSandro'|'714/536-9399'|''|''
+10|10|'Carmela '|'Munson'|'972/659-1514'|''|'cgm@mcsdallas.com'
+11|11|'Michael '|'Bisignani'|'212/480-3960'|''|''
+12|12|'Frank '|'Greco'|'212/482-5280'|''|'fgreco@crossroads-tech.com'
+13|13|'Dave'|'Dewan'|'781/238-5459'|'781/238-5499'|''
+14|14|'Lindsey'|'Williams'|'713/840-1224'|'713/840-1241'|'lwilliams@gorex.com'
+15|15|'Lance'|'Batten'|'510/283-5139'|''|'lance@tildenpark.com'
+16|17|'Michael '|'Hickman'|'716 546 3550'|''|'Hickman@bluelobster.com'
+17|19|'Steven '|'Mann'|'801 765 4010  ext 73'|''|'smann@corel.com'
+18|20|'Gary '|'Zakon'|''|''|'Gary.Zakon@novera.com'
+19|21|'Jason '|'Maynard'|'213/743-4226'|'213/749-7199'|'jmaynard@verix.com'
+20|23|'Chris '|'Herot'|'617/693-4026'|''|'herot@lotus.com'
+21|25|'Valon '|'Cross'|''|''|'spectrum@aimnet.com'
+22|28|'William'|'Coffin'|'415-813-8030'|''|''
+23|29|'Kia '|'Behnia'|'(415)-463-0174'|''|''
+24|30|'J. R.'|'Lowell'|'203 452 2750'|''|'jrlowell@mecasw.com'
+25|33|'Ron '|'Harris'|'512 794 1779'|''|'rharris@pervasive.com'
+26|35|'Carlos '|'Serrano-Morales'|'650/528-3450'|'650/943-2752'|'carlos.serrano-morales@neurondata.com'
+27|36|'Don '|'MacDonald'|'408/285-5558'|'408/285-6132'|'macdonald_don@tandem.com'
+28|37|'Scott '|'Rozic'|'415/538-1640'|'415/896-2561'|'scott@vergesoft.com'
+29|38|'Bob '|'Lee'|'408 541 3285'|''|''
+30|39|'Paul '|'Sholtz'|'650.482.2060'|''|'pjsholtz@omix.com'
+31|40|'Travis '|'Jensen'|'801-229-3189'|'801-229-3300'|'travisj@viewpoint.com'
+32|48|'Anthony'|'Bell'|''|''|''
+33|42|'Sean'|'Mickey'|'703/641-8511'|'703/207-0324'|'smickey@noblestar.com'
+35|44|'David'|'Brouse'|''|''|''
+36|45|'Charles '|'Barbour'|''|''|''
+37|46|'Daniel'|'MacDonald'|'619/458-9990'|'619/458-0136'|'dwm@msi.com'
+38|47|'Patrick'|'Vermont'|''|''|''
+39|49|'Warren'|'Reavis'|'650/604-3931'|'650/604-5244'|'reavis@nas.nasa.gov'
+40|50|'Lewis'|'Tucker'|''|''|''
+41|51|'Ward'|'Mullins'|'415/567-9945'|''|''
+58|42|'Amresh'|'Pathak'|'703/641-8511'|'703/207-0324'|'apathak@noblestar.com'
+59|53|'Karen'|'Watterson'|'619-271-5090'|''|'karen_watterson@email.msn.com'
+60|15|'Andy'|'Cohen'|'510/283-5139'|''|'acohen@tildenpark.com'
+61|52|'Bill'|'Li'|'510 739 2030 x113'|'510-739-0703'|'bill@internetimage.com'
+62|54|'Kevin'|'Gartner'|'541/754-4091'|''|'keving@roguewave.com '
+63|54|'Tom'|'Kim'|''|''|'kim@roguewave.com'
+64|50|'Abrahamski'|'Adam'|'408-343-1943'|''|''
+67|37|'Drew'|'Haller'|'415/538-1641'|''|'drew@vergesoft.com'
+66|56|'Ben'|'Mesander'|'303-448-0303'|'303-448-0205'|'ben@creativecorp.com'
+68|28|'Mike'|'McHugh'|'415/659-2658'|'415/394-8619 '|'mmchugh@weblogic.com   '
+69|2|'Douglas'|'Ellmore'|''|''|''
+71|58|'Greg'|'Smith'|'540-364-3341'|'540-364-3885'|'greg.smith@objectsystemsinc.com'
+72|59|'Mike'|'Stevens'|''|''|'stevens@dynavent.com'
+73|60|'Edward'|'Archibald'|'707-937-2976'|'707-937-2957'|'edward@mcn.org'
+74|61|'Edward'|'Langford'|''|''|'cybered@cyberglide.net'
+75|62|'Peter'|'Heirendt'|'503-643-1681'|'503-641-3321'|'heirendt@kentrox.com'
+76|63|'Daniel'|'Ellison'|'416-962-1809'|'416-962-0619'|''
+77|64|'Kenneth L.'|'Greenlee'|''|'919-781-0386'|''
+78|17|'Kevin'|'McMillen'|'716/546-3550'|'716/546-5488'|'kmcmillen@bluelobster.com'
+79|65|'Jia-Bao'|'Chu'|'650/655-3934'|'650/655-6750'|''
+80|65|'Viva'|'Chu'|'650/655-3934'|'650/655-6750'|'vivachu@infospace-inc.com'
+81|66|'William '|'Lyon'|'650/869-2200'|'650-869-2201'|''
+82|66|'Michael'|'Palombo'|'650/869-2200, 249'|'650/869-2201'|'mpalombo@openhorizon.com'
+83|67|'Stewart'|'Allen'|'703-352-1018'|'703-352-0370'|'sallen@webmethods.com'
+84|30|'Ron'|'Stickle'|'203/452-2600, x7019'|''|'rstickle@mecasw.com'
+85|68|'Peter'|'Wilkinson'|'860/986-2379'|''|''
+86|57|'Steve'|'Pringle'|'510/601.9879'|'510/339.6278'|'pringle@livemedia.com'
+87|50|'Alan'|'Chu'|'650/336-2977 '|''|'chu@eng.sun.com'
+88|69|'Greg'|'Sabatino'|'617/242-0925, x236'|'617/242-0430'|''
+89|70|'C. Reid'|'Flinn'|'804/231-1130'|'804/231-0167'|'cflinn@neweducation.com'
+90|70|'Adam'|'Rabung'|'804/359-4100'|''|'arabung@neweducation.com'
+91|71|'Steve'|'Pringle'|''|''|''
+92|72|'Daniel'|'Baskette'|'770-360-6436'|'770-360-6410'|'Dan.Baskette@East.Sun.COM'
+93|73|'Wayne'|'Duquaine'|'707-829-9633'|'707-829-7264'|'grandview@sonic.net'
+94|74|'Terence John'|'Parr'|'415-346-1070'|'415-563-4215'|'parrt@MageLang.com'
+95|75|'Craig'|'Newemark'|''|''|''
+96|76|'Doron'|'Gan'|'512.257.7260'|'512.378.3330'|'dgan@shafir.com'
+97|77|'Mark '|'Ashworth'|'360/733-2802'|'360/738-0377'|'MARK@PLANDS.COM'
+98|78|'Scott K.'|'McMullan'|'619.296.5548'|''|''
+99|79|'Paul '|'Czarnik'|'510.354.0940'|'510.354.0950'|''
+100|80|'Russ'|'Bartels'|'212/827-1346'|'212/382-0576'|'russ.bartels@hds.com'
+101|78|'Dave'|'Meagher'|''|''|'meagher@inovie.com'
+102|81|'Steve'|'Davidson'|'714.541.9737 ext.4316'|''|''
+103|35|'David'|'Wiser'|'650-'|''|'david.wiser@neurondata.com'
+104|35|'David'|'Mellor'|'560'|''|'david.mellor@neurondata.com'
+105|82|'Alan'|'Slater'|' 44 (0) 131.538.8850'|' 44 (0) 131.538.8851'|'info@orbital.tech.com'
+106|83|'Jan'|'Mazac'|'04423/9289-0'|'04423/9289-99'|'jwm@biss-net.com'
+107|84|'Michael J.'|'Murphy'|'703.506.5000'|'703.506.1757'|'mmurphay@grci.com'
+108|85|'Jon'|'Christensen'|'617.349.0050'|'617.349.0070'|'jmc@paintedword.com'
+109|86|'Mustafa'|'Syed'|'650.691.1100'|'650.962.5390'|'msyed@isadra.com'
+110|87|'Tim'|'Moses'|''|''|''
+111|88|'Adrian'|'Brown'|' 1 416.483.3485'|' 1 416.483.7069'|'adrian@fieldworker.com'
+112|89|'Brent'|'Johnston'|'604.433.0597'|'604.433.0257'|''
+113|90|'Peter '|'Brown'|'801.222.5510'|''|'pbrown@novell.com'
+114|8|'Thomas'|'Trifon'|'212/543-6066'|'212/543-5966'|'trifont@child.cpmc.columbia.edu'
+115|51|'Wilson'|'Daniel'|'415-863-9199'|'415-863-9191'|'dan@thoughtinc.com'
+116|91|'Scott R.'|'Anderson'|'612.688.3033'|'612.688.3113'|''
+117|92|'Nicolas'|'Dewaele'|'022.918.4589'|'022.918.4200'|'chibmz2m@ibmmail.com'
+118|93|'Zeez'|'Rozov'|'972.3.6880855'|'972.3.6880455'|''
+119|94|'Ed M.'|'Tighe                                             '|'817.267.0061'|'817.267.7625'|''
+120|95|'Savio'|'Lam'|'852.9260.8649'|''|'admin@cybotics.com'
+121|96|'James P.'|'Barber'|'1800.940.0011'|''|'jpbarber@intermedia.com'
+122|86|'Yilmaz'|'Cengeloglu'|''|''|'yilmaz@isadra.com'
+123|97|'Vasu'|'Muppalla'|'919.859.5200 x100'|'919.859.0515'|''
+124|0|'Igor'|'Mendelen'|'617.425.3595'|'617.425.3132'|'ibm@crai.com'
+125|98|'Brad '|'Miller'|'617.425.3000'|'617.425.3132'|''
+126|98|'Igor'|'Mendelev'|'617.425.3595'|'617.425.3132'|'ibm@crai.com'
+127|99|'Savvas'|'Xenophontos'|'510.597.5800'|'510.597.8787'|'sxenophontos@scopus.com'
+128|100|'Walter'|'Krafft'|''|' 49.6074-.4905256'|''
+129|101|'Brad'|'Marshall'|'800.450.5000'|'425.204.9565'|'brad@ostream.com'
+130|101|'Zachary'|'Kanner'|'800.450.5000'|'425.204.9565'|'zachary@ostream.com'
+131|102|'Joel'|'Neely'|'901.375.6586'|'901.375.6009'|'joel.neely@fedex.com'
+132|103|'Jeffery '|'Anuszczyk'|'1  781.270.4422'|'1  781.270.0840'|'jeffa@novera.com'
+134|104|'Bob'|'Chase'|'703.453.8343'|'703.453.8391'|'bchase@tnsi.com'
+135|104|'Rick'|'Troutman'|'703.453.8306'|'703.453.8399'|'rtroutman@tnsi.com'
+136|0|'Eric'|'Howe'|''|''|''
+137|105|'Paul'|'Melanson'|'416-977-4313'|'416-866-2970'|'pmel@interlog.com'
+138|105|'Eric'|'Howe'|'416-977-4313'|'416-866-2970'|''
+139|106|'Dave'|'Thurmond'|'770.232.8112'|'770.232.8194'|'d.thurmond@agcorp.com'
+140|107|'Robert'|'Klank'|'703.262.3200'|'703.262.3201'|'klank@proxicom.com'
+141|108|'David '|'Schloss'|'650.967.3700'|'650.967.3701'|''
+142|109|'Harry A.'|'Thuet'|'303.448.0303  ext.217'|'303.448.0205'|''
+143|110|'Peter'|'Yared'|'650.462.7600'|'650.617.5920'|''
+144|111|'Jim '|'Longson'|''|'800.511.2419'|'jiml@longson.com'
+145|112|||||
+146|113|'Mike'|'Kilgore'|'508.460.4000'|'508.460.4099'|'mkilgore@cerulean.com'
+147|114|'Evan'|'Maloney'|'212.513.7777'|'212.513.1014'|'evan@metaphoria.net'
+148|115|'Bhavini'|'Subramani'|'770.734.3926'|'770.734.3124'|'bhavini_subramani@atl.checkfree.com'
+149|116|'Brian'|'Houston'|'415.398.6340'|'415.392.6831'|'brian@vestec.com'
+150|117|'Jack'|'Hakim'|'415. 383.8051'|'415.383.8059'|'jack@ecwise.com'
+151|118|'Ed'|'Langhall'|'757.427.3322'|'757.368.0515'|'cybered@cyberglide.net'
+152|119|'Lorne'|'Levinson'|'08.9344080'|'972.8.9344101'|'fhlevins@wicc.weizmann.ac.il'
+153|120|'Cary'|'Knoop'|'650.425.2300'|''|'cknoop@acutate.com'
+154|83|'Matthias'|'Brauch'|''|''|'mb@biss-net.com'
+155|121|'Brian'|'Frank'|'804.747.4771'|'804.747.5204'|'brian@tridium.com'
+156|122|'Umashankar'|'Sathyanarayana'|'973.605.6532'|''|'sathayanar@mail.dnb.com'
+157|123|'Chris'|'Economy'|'510.675.4090'|''|'faith.economy@bankamerica.com'
+158|124|'Tomoko'|'Yamaguchi'|'81-75-957-9816'|''|'tomoko.yamguchi@omron.co.jp'
+159|125|'Bjorn'|'Buensuceso'|''|''|'bjorn_31@hotmail.com'
+160|126|'John'|'Pommier'|'415.338.1600'|''|'jpommier@stars.sfsu.edu'
+161|127|'Nobuhiko'|'Nagamori'|''|''|'setgraph@eka.att.nz.jp'
+162|128|'B.'|'Hoh'|'510.839.3684'|''|'bevhoh@hotmail.com'
+163|129|'Andreas'|'Dieckow'|'617.621.0600'|'617.494.1631'|'andreas@intersys.com'
+164|130|'George'|'Head'|'310.412.2368'|''|'ghead@fuser.com'
+165|131|'Vinay'|'Sabharwal'|'510.490.3666'|''|'vxs@home.com'
+166|132|'Michael'|'Connor'|'408.253.7515'|''|'mconnor@answerftwr.com'
+167|133|'Jose Ignacio'|'Uribe'|''|''|''
+168|122|'Anthony'|'Cozzini'|'973.605.6217'|''|'cozzinia@mail.dnb.com'
+169|43|'Nitin'|'Borwankar'|'510-653-8394'|'510-653-8394'|'nitin@borwankar.com'
+170|30|'John'|'Heerdt'|'203-452-2626'|''|'jheerdt@mecasw.com'
+171|79|'Dave'|'Veach'|'510.354.0940'|''|''
+172|134|'Mike'|'Davis'|''|'512.838.9813'|''
+173|135|'James'|'Patterson'|'(800) 672.4636 x1947'|'(412) 363.1375'|'jpatterson@msa.com'
+174|136|'Ronnie'|'Thomson'|'781.994.1027'|'781.863.7288'|'rthomson@centra.com'
+175|137|'Ken '|'Horowitz'|'212.741.1720'|''|'kenh@ergo-tech.com'
+176|138|'Dave '|'Brouse'|'717.731.8053'|'717.730.8968'|'dbrouse@highmark.com'
+177|139|'Janos'|'Mucsi'|'212.687.1810'|'212.687.1781'|'mucsij@ibm.net'
+178|140|'Dennis'|'Dennunzio'|'843.853.4781 x21'|'843.853.4133'|'dbd@sunbeltnetwork.com'
+179|141|'Richard'|'Gunn'|'01161299183666'|'01161299187388'|'rgunn@gunnsoft.com.au'
+180|142|'Kelby'|'Zordrager'|'703.248.2175'|'703.294.'|'kelby.zorgdrager@east.sun.com'
+181|143|'Pamela'|'Niedgrmayer'|'508.548.4470'|'508.548.8731'|''
+182|144|'Joseph'|'Molnar'|'416.777.1697'|'416.368.3086'|''
+183|145|'Gerald'|'Canfield'|'410-455-2649'|''|'canfield@umbc.edu'
+184|146|'Jonathan'|'Brown'|'401-272-7325'|''|'jbrown@templegames.com'
+185|147|'Anne '|'Troop'|'973.443.7539'|''|'amt@fpk.hp.com'
+186|148|'Richard'|'Hoad'|''|''|'Richard.Hoad@fao.org'
+187|149|'James'|'Sangroniz'|'208.396.4067'|'208.396.3457'|'james_sangroniz@hp.com'
+188|150|'Andrew '|'Scherpbier'|'619.278.5900'|'619.292.1454'|''
+189|151|'Andrew '|'Sodt'|'206 470 7538'|''|'asodt@adobe.com'
+190|152|'Martin '|'Higham'|'44 118 978 0331'|''|'martin@trefoil.demon.co.uk'
+191|153|'Franz '|'H�rmann'|'011-431-313-36-4680'|''|'franz.hoermann@wu-wien.ac.at'
+192|154|'Arne'|'Wilhelmsen'|'650.574.5023'|''|'arne@sevenmountains.com'
+193|155|'Danny'|'Pearce'|'209-855-2014'|''|'danny@computing-concepts.com'
+194|90|'David'|'Latour'|'801.222.4690'|'801.222.4677'|'dlatour@novell.com'
+195|156|'Rob ten'|'Kroode'|'( 31) 30 6344010'|'( 31) 30 6344011'|''
+196|146|'Greg'|'Brownell'|''|''|'gwb@consultant.com'
+197|157|'Roman'|'Stanek'|' 420 2 83 007 321'|' 420 2 83 007 399'|'roman.stanek@netbeans.com'
+198|158|'Tony'|'Curwen'|'714.566.1000 x23337'|'714.566.7830'|'tony.curwen@ingrammicro.com'
+199|159|'John Justin'|'Hough'|'210.523.4362'|'210.523.4396'|'jh1331@txmail.sbc.com'
+200|160|'Matt'|'Cooper'|'303.420.1148'|'303.420.2204'|'mcooper@mines.edu'
+201|161|'David '|'Warnock'|''|''|'david@sundayta.co.uk'
+202|162|'Paul'|'Smith'|''|''|'Paul_T_Smith@dell.com'
+203|163|'Christian'|'Trahan'|''|''|'ctrahan@verticalsoftware.com'
+204|164|'Eddy'|'Belefdil'|'(4122) 827.40.20'|'(4122) 827.40.25'|''
+205|165|'Jerry '|'Presley'|'972.659.1514'|'972.659.1624'|'jerryp@mcsdallas.com'
+206|166|'Tony'|'Pujals'|'408.235.8700 x101'|'408.235.8774'|'tony@objectmedia.com'

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/testData/build.xml	Tue Jan 11 11:53:57 2005
@@ -27,6 +27,10 @@
       <fileset dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/testData/v2"
         includesfile="${derby.testing.src.dir}/${derby.testing.functest.dir}/testData/v2/copyfiles.ant"/>
     </copy>
+    <copy todir="${out.dir}/${derby.testing.functest.dir}/testData/ImportExport">
+      <fileset dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/testData/ImportExport"
+        includesfile="${derby.testing.src.dir}/${derby.testing.functest.dir}/testData/ImportExport/copyfiles.ant"/>
+    </copy>
   </target>
 
 </project>

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LOBTest.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,500 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.LOBTest
+
+   Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.DriverManager;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Array;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.io.Reader;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Ref;
+import java.net.URL;
+import java.sql.PreparedStatement;
+import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+
+/**
+ * @author Jonas S Karlsson
+ */
+
+public class LOBTest {
+	/* the default framework is embedded*/
+	public static final String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+	public static final String protocol = "jdbc:derby:";
+        
+        
+	public static Connection connectAndCreate(String dbname) throws Exception {
+		// connect and create db
+		Class.forName(driver).newInstance(); // load driver
+		Connection conn = DriverManager.getConnection(protocol+dbname
+													  +";create=true");
+
+		conn.setAutoCommit(false);
+		return conn;
+	}
+	public static void disconnect(Connection conn) throws Exception {
+		conn.commit();
+		conn.close();
+	}
+    public static void printSQLError(SQLException e) {
+        while (e != null) {
+			System.out.print("\t");
+            System.out.println(e.toString());
+            e = e.getNextException();
+        }
+    }
+	//////////////////////////////////////////////////////////////////////
+	public static void largeTest(String[] args) throws Exception{
+		System.out.println("connecting");
+		Connection conn = connectAndCreate("LOBdb");
+		Statement s = conn.createStatement();
+
+		try {
+			System.out.println("dropping");
+			s.executeUpdate("DROP TABLE atable");
+		} catch (Exception e) {
+		}
+
+		System.out.println("creating");
+		s.executeUpdate("CREATE TABLE atable (a INT, b LONG VARCHAR FOR BIT DATA)");
+		conn.commit();
+		java.io.File file = new java.io.File("short.txt");
+		int fileLength = (int) file.length();
+
+		// first, create an input stream
+		java.io.InputStream fin = new java.io.FileInputStream(file);
+		PreparedStatement ps = conn.prepareStatement("INSERT INTO atable VALUES (?, ?)");
+		ps.setInt(1, 1);
+
+		// set the value of the input parameter to the input stream
+//              ps.setBinaryStream(2, fin, fileLength);
+		ps.setBinaryStream(2, fin, -1);
+		System.out.println("inserting");
+		ps.execute();
+		conn.commit();
+
+		// reading the columns
+		System.out.println("reading");
+		ResultSet rs = s.executeQuery("SELECT b, octet_length(b) FROM atable WHERE a = 1");
+		while (rs.next()) {
+			java.sql.Clob aclob = rs.getClob(1);
+			java.io.InputStream ip = rs.getAsciiStream(1);
+			System.out.println("octet_length = "+rs.getInt(2));
+		}
+
+		System.out.println("disconnecting");
+		disconnect(conn);
+	}
+
+    public static void typeTest(String[] args) throws Exception {
+
+		// use the ij utility to read the property file and
+			// make the initial connection.
+		ij.getPropertyArg(args);
+		Connection conn = ij.startJBMS();
+		
+		// old bit datatype, converted later to char () for bit data
+		new LOBTester(conn, "bit", "(8 )").test();
+		new LOBTester(conn, "bit", "(8 )").test();
+
+		new LOBTester(conn, "blob", "(2 M)").test();
+		new LOBTester(conn, "blob", "(2 K)").test();
+		new LOBTester(conn, "blob", "(64  )").test();
+
+		new LOBTester(conn, "clob", "(2 K)").test();
+		new LOBTester(conn, "clob", "(64  )").test();
+
+
+    	new LOBTester(conn, "blob", "(2 M)").testBlobInsert();
+		disconnect(conn);
+	}
+    public static void main(String[] args) {
+        try {
+//			if (args.length > 0) {
+//				largeTest(args);
+//			} else {
+				typeTest(args);
+//			}
+		}
+		catch (Throwable e) {
+			LOBTest.printException(e);
+		}
+	}
+
+	public static void printException(Throwable e) {
+		//System.out.println("\t Exception thrown:");
+		if (e instanceof SQLException) 
+			printSQLError((SQLException)e);
+		else
+			e.printStackTrace();
+    }
+}
+
+
+class LOBTester {
+    String typeName;
+    String typeSpec;
+    String table;
+    String[] colNames;
+    String[] colTypes;
+	int columns;
+	String[] colData;
+
+    Connection conn;
+    Statement st;
+
+    String[] typeNames = { "int", "char(10)", "varchar(80)", "long varchar", "char(10) for bit data", "long varchar for bit data", "blob(80)" };
+
+	static int BIT_OFFSET = 4;
+	static int LONG_VARBINARY_OFFSET = 5;
+	static int BLOB_OFFSET = 6;
+	static int TYPE_COL_OFFSET= 7;
+
+    public LOBTester(Connection c, String typeName, String typeSpec) throws SQLException {
+
+        this.conn = c;
+        this.typeName = typeName;
+        this.typeSpec = typeSpec;
+        this.table = typeName+"_table";
+        this.st = this.conn.createStatement();
+
+        columns = typeNames.length+1;
+        this.colNames = new String[columns];
+        this.colTypes = new String[columns];
+        for(int i=0; i<columns-1; i++) {
+            String colName = "col_"+i;
+            colNames[i] = colName;
+            colTypes[i] = typeNames[i];
+        }
+        colNames[columns-1] = "typecol";
+	String tmpTypeNameSpec;
+		if (typeName.equals("bit"))
+			tmpTypeNameSpec="char" +" "+typeSpec + " for bit data";
+		else
+			tmpTypeNameSpec=typeName+" "+typeSpec;
+		colTypes[columns-1] = tmpTypeNameSpec;
+		colData = new String[] { "100","'101'","'102'", "'103'",
+								 TestUtil.stringToHexLiteral("104"),
+								 TestUtil.stringToHexLiteral("105"),
+								 "CAST (" +TestUtil.stringToHexLiteral("106") +" AS " +
+								 colTypes[BLOB_OFFSET] +")",
+								 "CAST (" +TestUtil.stringToHexLiteral("107") +" AS " +
+								 tmpTypeNameSpec + ")" };
+		
+    }
+    public static void printResultSet(ResultSet rs) throws SQLException {
+        if (rs==null) return;
+        ResultSetMetaData md = rs.getMetaData();
+        int cols = md.getColumnCount();
+
+        boolean hasNext = true;
+        // according to javadoc, rs already points to first
+        // row, but it won't work if we don't call next()!
+
+        // print some metadata
+        for(int col=1; col<=cols; col++) {
+            System.out.println("\t---- "+col);
+            System.out.println("\tColumn    : "+md.getColumnName(col));
+            System.out.println("\tType      : "+md.getColumnType(col));
+            System.out.println("\tTypeName  : "+md.getColumnTypeName(col));
+            System.out.println("\tClassName : "+md.getColumnClassName(col));
+            System.out.println("\tLabel     : "+md.getColumnLabel(col));
+            System.out.println("\tDisplaySz : "+md.getColumnDisplaySize(col));
+            System.out.println("\tPrecision : "+md.getPrecision(col));
+            System.out.println("\tScale     : "+md.getScale(col));
+            System.out.println("\tisCurrency: "+md.isCurrency(col));
+            System.out.println("\tisCaseSens: "+md.isCaseSensitive(col));
+            System.out.println("\tisDefWrite: "+md.isDefinitelyWritable(col));
+            System.out.println("\tisWrite   : "+md.isWritable(col));
+            System.out.println("\tisSearchab: "+md.isSearchable(col));
+//			System.out.println("\tSchemaName: "+md.getSchemaName(col));
+            System.out.print("\n");
+        }
+
+        // print actual data
+        while (rs.next()) { // for each row
+            for(int col=1; col<=cols; col++) {
+                Object c = rs.getObject(col);
+                if (c==null)
+                    System.out.println("\tOUT = NULL");
+                else {
+                    // fixup if it contains classname (remove "random" part after @)
+                    String v = c.toString();
+                    if (v.indexOf('@') != -1) {
+                        v = v.substring(0, v.indexOf('@')+1);
+                        System.out.println("\tOUT = Object : "+prettyType(c));
+                    } else 
+                        System.out.println("\tOUT = '"+v+"' : "+c.getClass().getName());
+                }
+            }
+        }
+    }
+    public ResultSet X(String sql) throws SQLException {
+        try {
+            System.out.println("\n"+sql);
+            // cercumwait stupid executeQuery which can't take non-selects...
+            boolean result = ( (sql.charAt(0) == 'S') || (sql.charAt(0) == 's')); // detect "select" which returns result..
+            if (!result) {
+                st.execute(sql);
+            } else {
+                return st.executeQuery(sql);
+            }
+        } catch (Throwable e) {
+            LOBTest.printException(e);
+        }
+        return null;
+    }
+    public void Xprint(String sql) {
+        try {
+            ResultSet rs = X(sql);
+            printResultSet(rs);
+        } catch (Throwable e) {
+            LOBTest.printException(e);
+        }
+    }
+    static String[] getterName = {
+        "getObject", "getArray", "getAsciiStream", // 2
+        "getBigDecimal", "getBinaryStream", "getBlob", // 5
+        "getBoolean", "getByte", "getBytes", // 8
+        "getCharacterStream", "getClob", "getDate", // 11
+        "getDouble", "getFloat", "getInt", "getLong", // 15
+        "getRef", "getShort", "getString", "getTime", // 19
+        "getTimeStamp", "getURL" // 21
+    };
+
+    // getter takes a RESULTSET and uses GETTER on COLumn
+    // getters numbered 0..N-1, for N-1 null is returned
+    // otherwise descriptive string is returned
+    // if the getter throws exception the string says so
+    public static String getter(ResultSet rs, int getter, int col) {
+        Object o = "-NO VALUE-";
+        String s = "";
+        try {
+            if (getter < getterName.length) { // avoid array exception
+                s = getterName[getter];
+                for(int i=s.length(); i<20; i++) s+=' ';
+                s += " ->";
+            }
+
+            switch(getter) {
+                case 0: {o = rs.getObject(col); break;}
+                case 1: {Array v=rs.getArray(col);o=v;break;}
+                case 2: {InputStream v=rs.getAsciiStream(col);o=v;break;}
+                case 3: {BigDecimal v=rs.getBigDecimal(col);o=v;break;}
+                case 4: {InputStream v=rs.getBinaryStream(col);o=v;break;}
+                case 5: {Blob v=rs.getBlob(col);o=v;break;}
+                case 6: {boolean v=rs.getBoolean(col);o=new Boolean(v);break;}
+                case 7: {byte v=rs.getByte(col);o=new Byte(v);break;}
+                case 8: {byte[] v=rs.getBytes(col);o=v;break;}
+                case 9: {Reader v=rs.getCharacterStream(col);o=v;break;}
+                case 10:{Clob v=rs.getClob(col);o=v;break;}
+                case 11:{Date v=rs.getDate(col);o=v; break;}
+                case 12:{double v=rs.getDouble(col);o=new Double(v);break;}
+                case 13:{float v=rs.getFloat(col);o=new Float(v);break;}
+                case 14:{int v=rs.getInt(col);o=new Integer(v);break;}
+                case 15:{long v=rs.getLong(col);o=new Long(v);break;}
+                case 16:{Ref v=rs.getRef(col);o=v;break;}
+                case 17:{short v=rs.getShort(col);o=new Short(v);break;}
+                case 18:{String v=rs.getString(col);o=v;break;}
+                case 19:{Time v=rs.getTime(col);o=v;break;}
+                case 20:{Timestamp v=rs.getTimestamp(col);o=v;break;}
+//				case 21:{URL v=rs.getURL(col);o=v;break;}
+                default: return null;
+            }
+            // fixup if it contains classname (remove "random" part after @)
+            String v = o.toString();
+            if (v.indexOf('@') != -1) { // non standard java object.
+                s += "Object'   \t: "+prettyType(o);
+            } else {
+                // default stringifier...
+                s += "'"+v+"'    \t: "+o.getClass().getName();
+            }
+        } catch (Throwable e) {
+            s += "\t\tEXCEPTION ("+e.getMessage()+")";
+        }
+        return s;
+    }
+    static public String prettyType(Object o) {
+        if (o instanceof java.sql.Blob) return "java.sql.Blob";
+        if (o instanceof java.sql.Clob) return "java.sql.Clob";
+        if (o instanceof java.io.InputStream) return "java.io.InputStream";
+        if (o instanceof java.io.Reader) return "java.io.Reader";
+        if (o instanceof byte[]) return "byte[]";
+        return "Unknown type - "+o.getClass().getName();
+    }
+    public void testGetters() throws SQLException {
+        for(int i=0; i<columns; i++) {
+            System.out.println("\n\n=== Columntype "+colTypes[i]);
+            String s = "select "+colNames[i]+" from "+table;
+            ResultSet rs = X(s);
+            rs.next(); // goto first
+            int getno = 0;
+            String r;
+            while(null!=(r = getter(rs, getno, 1))) {
+                System.out.println("\t"+i+" "+r);
+                getno++;
+            }
+        }
+    } 
+    public void testMetaData() {
+        System.out.println("\n\n---< METADATA TESTS\n");
+        // plain select
+        for(int i=0; i<columns; i++) {
+            String s = "select "+colNames[i]+" from "+table;
+            Xprint(s);
+        }
+    }
+    public void testCastTo() {
+        System.out.println("\n\n---< type CAST TO types: METADATA TESTS\n");
+        // CAST ( column TO types )
+        for(int i=0; i<columns; i++) {
+            String s;
+            if (colTypes[i].startsWith("bit"))
+                s = "select cast( typecol as char (8) for bit data) from "+table;
+            else
+                s = "select cast( typecol as "+colTypes[i]+" ) from "+table;
+            Xprint(s);
+        }
+    }
+    public void testCastFrom() {
+        System.out.println("\n\n---< columns CAST TO type: METADATA TESTS\n");
+        // CAST ( coltypes TO type )
+        for(int i=0; i<columns; i++) {
+            String s;
+            if (typeName.startsWith("bit"))
+		{
+	        s = "select cast( "+colNames[i]+" as char (8) for bit data ) from "+table;
+		}
+            else
+                s = "select cast( "+colNames[i]+" as "+typeName+typeSpec+" ) from "+table;
+            Xprint(s);
+        }
+    }
+	public void testBlobInsert() {
+
+		System.out.println("\n\n---< BLOB Insertion Tests\n");
+        // create table for testing
+        {
+            Xprint("create table blobCheck (bl blob(80)) ");
+        }
+
+		// test insertion of literals.
+		for (int i=0; i < columns; i++) {
+
+			if (colTypes[i].indexOf("blob") == -1)
+				continue;
+
+			// Check char literals.
+			// (fail)
+            String insert = "insert into blobCheck (bl" +
+				" ) values ('string' )";
+			Xprint(insert);
+			// (succeed)
+            insert = "insert into blobCheck (bl" +
+				" ) values (cast (" +
+				TestUtil.stringToHexLiteral("string") +
+				" as blob(80)) )";
+			Xprint(insert);
+			// Check bit literals.
+			// (fail)
+            insert = "insert into blobCheck (bl" +
+				" ) values (X'48' )";
+			Xprint(insert);
+			// old CS compatible value:  ( b'01001' )
+			// (succeed)
+            insert = "insert into blobCheck (bl" +
+				" ) values (cast (X'C8' as blob(80)) )";
+			Xprint(insert);
+			// Check hex literals.
+			// (fail)
+            insert = "insert into blobCheck (bl" +
+				" ) values ( X'a78a' )";
+			Xprint(insert);
+			// (succeed)
+            insert = "insert into blobCheck (bl" +
+				" ) values (cast (X'a78a' as blob(80)) )";
+			Xprint(insert);
+		}
+	}
+    public void test() throws SQLException {
+        // create table for testing
+        {
+            String create = "create table "+table+" ( dummy int ";
+            for(int i=0; i<columns; i++) {
+                create += ", "+colNames[i]+" "+colTypes[i];
+            }
+            create += " )";
+            Xprint(create);              //st.execute(create);
+        }
+        // insert one row of numbers in string format if possible.
+        {
+            String insert = "insert into "+table+" values ( 45 ";
+				for(int i=0; i<columns; i++) {
+					insert += "," + colData[i] ;
+				}
+            insert += " )";
+            Xprint(insert);
+        }
+
+        // insert various data in various columns, some will fail (int)
+        {
+            for(int i=0; i<columns; i++) {
+                String insert = "insert into "+table+" ( "+colNames[i];
+				if (isBitColumn(i))
+				// have to cast for blob columns.
+					insert += " ) values cast ( " +
+						TestUtil.stringToHexLiteral("true") +
+						"  AS " + colTypes[i] + ")";
+				else
+                    insert += " ) values ( 'true' )";
+                Xprint(insert);
+            }
+        }
+
+        // run tests
+        testGetters();
+        testMetaData();
+        testCastFrom();
+        testCastTo();
+
+        // cleanup
+        Xprint("drop table "+table); //st.execute("drop table "+table);
+    }
+
+	private boolean isBitColumn(int offset)
+	{
+		return  ((offset == BLOB_OFFSET) ||
+				 (offset == BIT_OFFSET) ||
+				 (offset == LONG_VARBINARY_OFFSET) ||
+				 (offset == TYPE_COL_OFFSET)
+				 );
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StmtCloseFunTest.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,842 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.StmtCloseFunTest
+
+   Copyright 2000, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import org.apache.derby.tools.ij;
+import java.sql.DriverManager;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.sql.PreparedStatement;
+import java.sql.CallableStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.lang.Float;
+import java.sql.Date;
+import java.sql.Types;
+import java.util.GregorianCalendar;
+import org.apache.derby.iapi.reference.JDBC20Translation;
+
+public class StmtCloseFunTest {
+    
+
+	static private boolean isDerbyNet = false;
+
+    public static void main(String[] args) {
+
+		System.out.println("Statement Close Fun Test starting ");
+
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+
+		try {
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			Connection conn = ij.startJBMS();
+			test1(conn);
+			test2(conn);
+			test3(conn);
+
+			conn.close();		
+				
+		} catch (SQLException e) {
+			dumpSQLExceptions(e);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			e.printStackTrace(System.out);
+		}
+
+		System.out.println("Statement Close Fun Test finished");
+	}
+
+    private static void test1(Connection conn) {
+		Statement s;
+        try {
+			System.out.println("Statement test begin");
+				s = conn.createStatement();
+				/*
+				  We create a table, add a row, and close the statement.
+				*/
+				s.execute("create table tab1(num int, addr varchar(40))");
+				s.execute("insert into tab1 values (1910,'Union St.')");
+				s.close();
+		  				
+			try {
+				s.executeQuery("create table tab2(num int)");
+				System.out.println("Statement Test failed (1)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.executeUpdate("update tab1 set num=180, addr='Grand Ave.' where num=1910");
+				System.out.println("Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			/* close() is the only method that can be called
+			 * after a Statement has been closed, as per
+			 * Jon Ellis.
+			 */
+			try {
+				s.close();
+			}
+			catch(SQLException e) { 
+				System.out.println("Statement Test failed (2) " + e.toString());
+			}
+
+			try {
+				s.execute("insert into tab1 values (300,'Lakeside Dr.')");
+				System.out.println("Statement Test failed (3)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getMaxFieldSize();
+				System.out.println("Statement Test failed (4)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.setMaxFieldSize(100);
+				System.out.println("Statement Test failed (5)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getMaxRows();
+				System.out.println("Statement Test failed (6)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.setMaxRows(1000);
+				System.out.println("Statement Test failed (7)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.setEscapeProcessing(true);
+				System.out.println("Statement Test failed (8)");
+			}
+			catch(SQLException e) { }
+
+			if (! isDerbyNet)
+			{
+				try {
+					// currently derby only supports returning 0 in this case.
+					
+					int qry_timeout = s.getQueryTimeout();
+					
+					if (qry_timeout != 0)
+						System.out.println("Statement Test failed, must return 0.");
+				}
+				catch(SQLException e)
+				{
+					System.out.println("Statement Test failed (9) " + e.toString());
+				}
+			}
+			try {
+				s.setQueryTimeout(20);
+				System.out.println("Statement Test failed (10)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.cancel();
+				System.out.println("Statement Test failed (11)");
+			}
+			catch(SQLException e) { }
+
+			if (isDerbyNet)
+				System.out.println("beetle 5524");
+			try {
+				s.getWarnings();
+				System.out.println("Statement Test failed (12)");
+			}
+			catch(SQLException e) { }
+		
+			if (isDerbyNet)
+				System.out.println("beetle 5524");			
+			try {
+				s.clearWarnings();
+				System.out.println("Statement Test failed (13)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.setCursorName("ABC");
+				System.out.println("Statement Test failed (14)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.execute("create table tab3(num int)");
+				System.out.println("Statement Test failed (15)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getResultSet();
+				System.out.println("Statement Test failed (16)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getUpdateCount();
+				System.out.println("Statement Test failed (17)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getMoreResults();
+				System.out.println("Statement Test failed (18) ");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getResultSetType();
+				System.out.println("Statement Test failed (19)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.setFetchDirection(JDBC20Translation.FETCH_FORWARD);
+				System.out.println("Statement Test failed (20)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.setFetchSize(100);
+				System.out.println("Statement Test failed (21)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getFetchSize();
+				System.out.println("Statement Test failed (22)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getResultSetConcurrency();
+				System.out.println("Statement Test failed (23)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.addBatch("create table tab3(age int)");
+				System.out.println("Statement Test failed (24)");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.clearBatch();
+				System.out.println("Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.executeBatch();
+				System.out.println("Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				s.getConnection();
+				System.out.println("Statement Test failed");
+			}
+			catch(SQLException e) { }
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			e.printStackTrace(System.out);
+			return;
+		}
+		System.out.println("Statement test end");
+}
+
+     private static void test2(Connection conn) {
+		PreparedStatement ps;
+        try {
+			System.out.println("Prepared Statement test begin");
+			ps = conn.prepareStatement("create table tab2(a int, b float, c date, d varchar(100))");
+			ps.execute();
+		  	ps.close();
+
+			//we test execute() and executeQuery() here
+			ps =  conn.prepareStatement("select a from tab2");
+			ps.execute();
+			ps.close();
+			try {
+				ps.execute();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+   			try {
+				ps.executeQuery();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+		
+			ps = conn.prepareStatement("insert into tab2 values(?, ?, ?, ?)");
+		   	/*
+		   	  We create a table, add a row, and close the statement.
+		   	*/
+		   	ps.setInt(1, 420);
+		   	ps.setFloat(2, (float)12.21);
+		   	ps.setDate(3, new Date(1971, 1, 10));
+		   	ps.setString(4, "China");
+		   	ps.executeUpdate();
+		   	ps.close();
+		  				
+			//now, we begin the test
+			try {
+				ps.setInt(1, 530);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setFloat(2, (float)3.14);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setDate(3, new Date(1975, 11, 15));
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setDate(3, new Date(1975, 11, 15), new GregorianCalendar());
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setString(4, "HongKong");
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.executeUpdate();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			/* close() is the only method that can be called
+			 * after a Statement has been closed, as per
+			 * Jon Ellis.
+			 */
+			try {
+				ps.close();
+			}
+			catch(SQLException e) { 
+				System.out.println("Prepared Statement Test failed");
+			}
+
+			try {
+				ps.clearParameters();
+				System.out.println("Prepared Statement Test failed"); 
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getMetaData();
+				System.out.println("Prepared Statement Test failed"); 
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getMaxFieldSize();
+				System.out.println("Prepared Statement Test failed"); 
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setMaxFieldSize(100);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getMaxRows();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setMaxRows(1000);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setEscapeProcessing(true);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			if (! isDerbyNet)
+			{
+				try {
+					// currently derby only supports returning 0 in this case.
+					
+					int qry_timeout = ps.getQueryTimeout();
+					
+					if (qry_timeout != 0)
+						System.out.println("Statement Test failed, must return 0.");
+				}
+				catch(SQLException e)
+				{ 
+					System.out.println("Statement Test failed");
+				}
+			}
+
+			try {
+				ps.setQueryTimeout(20);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.cancel();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+			
+			if (isDerbyNet)
+				System.out.println("beetle 5524");	
+			try {
+				ps.getWarnings();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			if (isDerbyNet)
+				System.out.println("beetle 5524");	
+			try {
+				ps.clearWarnings();
+			    System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setCursorName("ABC");
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.execute("create table tab3(num int)");
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getResultSet();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getUpdateCount();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getMoreResults();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getResultSetType();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setFetchDirection(JDBC20Translation.FETCH_FORWARD);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.setFetchSize(100);
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getFetchSize();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getResultSetConcurrency();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.addBatch();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.clearBatch();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.executeBatch();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				ps.getConnection();
+				System.out.println("Prepared Statement Test failed");
+			}
+			catch(SQLException e) { }
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			e.printStackTrace(System.out);
+			return;
+		}
+		System.out.println("Prepared Statement test end");
+}
+
+     private static void test3(Connection conn) {
+		CallableStatement cs;
+        try {
+			System.out.println("Callable Statement test begin");
+			try {
+
+				Statement s = conn.createStatement();
+
+				s.execute("CREATE PROCEDURE takesString(OUT P1 VARCHAR(40), IN P2 INT) " +
+						"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.takesString'" +
+						" NO SQL LANGUAGE JAVA PARAMETER STYLE JAVA");
+
+
+				cs = conn.prepareCall("call takesString(?,?)");
+			
+				cs.registerOutParameter(1, Types.CHAR);
+				cs.setInt(2, Types.INTEGER);
+
+				cs.execute();
+				System.out.println("The result is " + cs.getString(1));
+
+				cs.close();
+
+				try {
+					cs.setString(1, "ABC");
+					System.out.println("Callable Statement Test failed");
+				}
+				catch(SQLException e) { }
+
+				try {
+					cs.registerOutParameter(1, Types.CHAR);
+					System.out.println("Callable Statement Test failed");
+				}
+				catch(SQLException e) { }
+
+				s.execute("drop procedure takesString");
+				s.close();
+			}
+		
+			catch(SQLException e) { 
+				dumpSQLExceptions(e);
+			}
+		
+			//now, testing all the inherited functions
+			cs = conn.prepareCall("create table tab3(a int, b float, c varchar(100))");
+			cs.execute();
+		  	cs.close();
+
+			//we test execute() and executeQuery() here
+			cs =  conn.prepareCall("select a from tab3");
+			ResultSet rs = cs.executeQuery();
+			cs.close();
+			try {
+				cs.execute();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+   			try {
+				cs.executeQuery();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+		
+			cs = conn.prepareCall("insert into tab3 values(?, ?, ?)");
+		   	/*
+		   	  We create a table, add a row, and close the statement.
+		   	*/
+		   	cs.setInt(1, 420);
+		   	cs.setFloat(2, (float)12.21);
+		   	cs.setString(3, "China");
+
+			cs.executeUpdate();
+		   	cs.close();
+		  				
+			//now, we begin the test
+			try {
+				cs.setInt(1, 530);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setFloat(2, (float)3.14);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setString(3, "HongKong");
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.executeUpdate();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			/* close() is the only method that can be called
+			 * after a Statement has been closed, as per
+			 * Jon Ellis.
+			 */
+			try {
+				cs.close();
+			}
+			catch(SQLException e) { 
+				System.out.println("Callable Statement Test failed");
+			}
+
+			try {
+				cs.clearParameters();
+				System.out.println("Callable Statement Test failed"); 
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getMetaData();
+				System.out.println("Callable Statement Test failed"); 
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getMaxFieldSize();
+				System.out.println("Callable Statement Test failed"); 
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setMaxFieldSize(100);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getMaxRows();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setMaxRows(1000);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setEscapeProcessing(true);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			if (! isDerbyNet)
+			{
+				try {
+					// currently derby only supports returning 0 in this case.
+					
+					int qry_timeout = cs.getQueryTimeout();
+					
+					if (qry_timeout != 0)
+						System.out.println("Statement Test failed, must return 0.");
+				}
+				catch(SQLException e)
+				{ 
+					System.out.println("Statement Test failed");
+				}
+			}
+			
+			try {
+				cs.setQueryTimeout(20);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.cancel();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			if (isDerbyNet)
+				System.out.println("beetle 5524");	
+			try {
+				cs.getWarnings();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			if (isDerbyNet)
+				System.out.println("beetle 5524");	
+			try {
+				cs.clearWarnings();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setCursorName("ABC");
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.execute("create table tab3(num int)");
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getResultSet();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getUpdateCount();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getMoreResults();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getResultSetType();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setFetchDirection(JDBC20Translation.FETCH_FORWARD);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.setFetchSize(100);
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getFetchSize();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getResultSetConcurrency();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.addBatch();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.clearBatch();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.executeBatch();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+
+			try {
+				cs.getConnection();
+				System.out.println("Callable Statement Test failed");
+			}
+			catch(SQLException e) { }
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			e.printStackTrace(System.out);
+			return;
+		}
+		System.out.println("Callable Statement test end");
+}
+
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception: " + se.toString());
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se = se.getNextException();
+		}
+	}
+
+}
+
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/aclob.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/aclob.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/aclob.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3000 @@
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwI-am-hiding-here-at-position-5910-in-this-humungus-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwHere-I-am-at-position-299003-near-the-end-of-the-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,931 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.autoGeneratedJdbc30
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.SQLException;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test the new Auto Generated Keys feature in jdbc 30 for Statement and PreparedStatement.
+ *
+ * @author mamta
+ */
+
+public class autoGeneratedJdbc30 { 
+	public static void main(String[] args) {
+
+		Connection con = null;
+		Statement  s;
+		PreparedStatement  ps;
+
+		System.out.println("Test autoGeneratedJdbc30 starting");
+
+		try
+		{
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+
+			s = con.createStatement();
+			/* Create the tables and do any other set-up */
+			setUpTest(s);
+			con.setAutoCommit(false);
+
+			positiveTests(con);
+
+			doTest1920(s, con);
+
+			negativeTests(con);
+
+			con.close();
+		}
+		catch (SQLException e) {
+			JDBCDisplayUtil.ShowSQLException(System.out,e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+
+		System.out.println("Test autoGeneratedJdbc30 finished");
+	}
+
+	public static String MyMethodWithNoInsert() throws SQLException {
+		System.out.println("Inside server-side method with no insert statement");
+		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		Statement s = conn.createStatement();
+		s.executeQuery("select * from t11");
+		return "true";
+	}
+
+	public static String MyMethodWithInsert() throws SQLException {
+		System.out.println("Inside server-side method with couple insert statement with various combination of auto generated keys flag");
+		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		Statement s = conn.createStatement();
+		s.execute("insert into t11(c11) values(999)", Statement.RETURN_GENERATED_KEYS);
+		dumpRS(s.getGeneratedKeys());
+		s.execute("insert into t11(c11) values(999)", Statement.NO_GENERATED_KEYS);
+		try {
+			dumpRS(s.getGeneratedKeys());
+		} catch (SQLException e) {
+			dumpExpectedSQLExceptions(e);
+		}
+		dumpRS(s.executeQuery("select * from t11"));
+		return "true";
+	}
+
+	public static int count(Connection con, Statement s) throws SQLException {
+		int count = 0;
+		ResultSet rs = s.executeQuery("select count(*) from t11");
+		rs.next();
+		count = rs.getInt(1);
+		rs.close();
+		return count;
+	}
+
+	//Set up the test by creating the table used by the rest of the test.
+	public static void setUpTest(Statement s)
+					throws SQLException {
+		/* Create a table */
+		// set by increment not yet supported for create table...
+		// does not matter for purpose of this test.
+		// s.execute("create table t11 (c11 int, c12 int default set increment by 1)");
+		s.execute("create table t11 (c11 int, c12 int generated always as identity)");
+		s.execute("alter table t11 alter c12 set increment by 1");
+		s.execute("create table t21 (c21 int not null unique, c22 char(5))");
+		s.execute("insert into t21 values(21, 'true')");
+		s.execute("insert into t21 values(22, 'true')");
+		s.execute("create table t31 (c31 int, c32 int generated always as identity, c33 int default 2)");
+		s.execute("alter table t31 alter c32 set increment by 1");
+	}
+
+	public static void dumpExpectedSQLExceptions (SQLException se) {
+		System.out.println("PASS -- expected exception");
+		while (se != null)
+		{
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se.getMessage());
+			se = se.getNextException();
+        }
+    }
+
+
+	// lifted from the metadata test	
+	public static void dumpRS(ResultSet s) throws SQLException 
+	{
+		if (s == null)
+		{
+			System.out.println("<NULL>");
+			return;
+		}
+
+		ResultSetMetaData rsmd = s.getMetaData();
+
+		// Get the number of columns in the result set
+		int numCols = rsmd.getColumnCount();
+
+		if (numCols <= 0) 
+		{
+			System.out.println("(no columns!)");
+			return;
+		}
+
+		StringBuffer heading = new StringBuffer("\t ");
+		StringBuffer underline = new StringBuffer("\t ");
+
+		int len;
+		// Display column headings
+		for (int i=1; i<=numCols; i++) 
+		{
+			if (i > 1) 
+			{
+				heading.append(",");
+				underline.append(" ");
+			}
+			len = heading.length();
+			heading.append(rsmd.getColumnLabel(i));
+			len = heading.length() - len;
+			for (int j = len; j > 0; j--)
+			{
+				underline.append("-");
+			}
+		}
+		System.out.println(heading.toString());
+		System.out.println(underline.toString());
+		
+	
+		StringBuffer row = new StringBuffer();
+		// Display data, fetching until end of the result set
+		while (s.next()) 
+		{
+			row.append("\t{");
+			// Loop through each column, getting the
+			// column data and displaying
+			for (int i=1; i<=numCols; i++) 
+			{
+				if (i > 1) row.append(",");
+				row.append(s.getString(i));
+			}
+			row.append("}\n");
+		}
+		System.out.println(row.toString());
+		s.close();
+	}
+
+	public static void disabledTestsBecauseOfBug5580(Statement s, Connection con, PreparedStatement ps) throws SQLException
+	{
+			// re-enable following test whenever bug 5580 fixed
+			//Test11 - insert select with columnIndexes[] array - bug 5580
+			System.out.println("Test11 - insert select with columnIndexes[] array");
+			int colPositions[] = new int[1];
+      colPositions[0] = 1;
+			s.execute("insert into t11(c11) select c21 from t21", colPositions);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colPositions);
+			dumpRS(s.getGeneratedKeys());
+
+			System.out.println("Test11ps - insert select with columnIndexes[] array");
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colPositions);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			// BUG 4836 Hey, actually fetch a generated column!!!!!!!!!!!!!
+			colPositions[0] = 2;
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colPositions);
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colPositions);
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			//Verify data in the table
+			if(count(con,s) != 12) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test12 - insert select with columnIndexes[] array with duplicate column positions
+			System.out.println("Test12 - insert select with columnIndexes[] array with duplicate column positions");
+			colPositions = new int[2];
+      colPositions[0] = 1;
+      colPositions[1] = 1;
+			s.execute("insert into t11(c11) select c21 from t21", colPositions);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colPositions);
+			dumpRS(s.getGeneratedKeys());
+
+			System.out.println("Test12ps - insert select with columnIndexes[] array with duplicate column positions");
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colPositions);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			//Verify data in the table
+			if(count(con,s) != 8) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test13 - insert select with columnIndexes[] array with invalid column position
+			System.out.println("Test13 - insert select with columnIndexes[] array with invalid column position");
+      colPositions[0] = 3;
+			try {
+				s.execute("insert into t11(c11) select c21 from t21", colPositions);
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				s.executeUpdate("insert into t11(c11) select c21 from t21", colPositions);
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+        dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			System.out.println("Test13ps - insert select with columnIndexes[] array with invalid column position");
+			try {
+				ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colPositions);
+				ps.execute();
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				ps.executeUpdate();
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			//Verify data in the table
+			if(count(con,s) != 0) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test14 - insert select with columnNames[] array
+			System.out.println("Test14 - insert select with columnNames[] array");
+			String colNames[] = new String[1];
+      colNames[0] = "C11";
+			s.execute("insert into t11(c11) select c21 from t21", colNames);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colNames);
+			dumpRS(s.getGeneratedKeys());
+
+			System.out.println("Test14ps - insert select with columnNames[] array");
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colNames);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			// BUG 4836 Hey, actually fetch a generated column!!!!!!!!!!!!!
+			colNames[0] = "C12";
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colNames);
+			dumpRS(s.getGeneratedKeys());
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colNames);
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			//Verify data in the table
+			if(count(con,s) != 12) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test15 - insert select with columnNames[] array with duplicate column names
+			System.out.println("Test15 - insert select with columnNames[] array with duplicate column names");
+			colNames = new String[2];
+      colNames[0] = "C11";
+      colNames[1] = "C11";
+			s.execute("insert into t11(c11) select c21 from t21", colNames);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colNames);
+			dumpRS(s.getGeneratedKeys());
+
+			System.out.println("Test15ps - insert select with columnNames[] array with duplicate column names");
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colNames);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			//Verify data in the table
+			if(count(con,s) != 8) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test16 - insert select with columnNames[] array with invalid column name
+			colNames = new String[1];
+			System.out.println("Test16 - insert select with columnNames[] array with invalid column name");
+      colNames[0] = "C13";
+			try {
+				s.execute("insert into t11(c11) select c21 from t21", colNames);
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				s.executeUpdate("insert into t11(c11) select c21 from t21", colNames);
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			System.out.println("Test16ps - insert select with columnNames[] array with invalid column name");
+			try {
+				ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colNames);
+				ps.execute();
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				ps.executeUpdate();
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			//Verify data in the table
+			if(count(con,s) != 0) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test17 - insert select with null columnIndexes[] internally switches to Statement.NO_GENERATED_KEYS
+			System.out.println("Test17 - insert select with null columnIndexes[] internally switches to Statement.NO_GENERATED_KEYS");
+			colPositions = null;
+			s.execute("insert into t11(c11) select c21 from t21", colPositions);
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colPositions);
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			System.out.println("Test17ps - insert select with null columnIndexes[] internally switches to Statement.NO_GENERATED_KEYS");
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colPositions);
+			ps.execute();
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			ps.executeUpdate();
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			//Verify data in the table
+			if(count(con,s) != 8) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test18 - insert select with null columnNames[] internally switches to Statement.NO_GENERATED_KEYS
+			System.out.println("Test18 - insert select with null columnNames[] internally switches to Statement.NO_GENERATED_KEYS");
+			colNames = null;
+			s.execute("insert into t11(c11) select c21 from t21", colNames);
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			s.executeUpdate("insert into t11(c11) select c21 from t21", colNames);
+			try {
+				dumpRS(s.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			System.out.println("Test18ps - insert select with null columnNames[] internally switches to Statement.NO_GENERATED_KEYS");
+			ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colNames);
+			ps.execute();
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+			ps.executeUpdate();
+			try {
+				dumpRS(ps.getGeneratedKeys());
+			} catch (SQLException e) {
+				dumpExpectedSQLExceptions(e);
+			}
+
+			//Verify data in the table
+			if(count(con,s) != 8) {
+				System.out.println("Test failed");
+				return;
+			}
+			s.execute("delete from t11");
+
+			//Test19a - insert values with column position order which doesn't match column positions in the actual table
+			//The column positions correspond to columns in the table and not the columns in the insert statement
+			System.out.println("Test19a - insert values with column position order which doesn't match column positions in the actual table");
+			colPositions = new int[1];
+			colPositions[0] = 1;
+			s.execute("insert into t21(c22,c21) values('true', 23)", colPositions);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t21(c22,c21) values('true', 23)", colPositions);
+			dumpRS(s.getGeneratedKeys());
+
+			//Test19aps - insert values with column position order which doesn't match column positions in the actual table
+			System.out.println("Test19aps - insert values with column position order which doesn't match column positions in the actual table");
+			ps = con.prepareStatement("insert into t21(c22,c21) values('true', 23)", colPositions);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			//Verify data in the table
+			dumpRS(s.executeQuery("select count(*) from t21"));
+			s.execute("delete from t11");
+	}
+
+	private static void positiveTests(Connection conn) throws SQLException
+	{
+			System.out.println("Test 1 - request for generated keys resultset on a brand new statement with no sql executed on it yet");
+			System.out.println("We will get a resultset with no rows because it is a non-insert sql");
+			Statement s = conn.createStatement();
+			dumpRS(s.getGeneratedKeys());
+
+			System.out.println("Test2 - request for generated keys on a statement which does select from a table ie a non-insert sql");
+			s.execute("select * from t11", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We will get a resultset with no rows because it is a non-insert sql");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			PreparedStatement ps = conn.prepareStatement("select * from t11", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 3 - insert multiple rows into a table with autogenerated key and request generated keys resultset");
+			System.out.println(" We will get a row with NULL value because this insert sql inserted more than one row and ");
+			System.out.println(" there was no prior one-row insert into a table with autogenerated key");
+			s.execute("insert into t31(c31) values (99), (98), (97)", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t31(c31) values (99), (98), (97)", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t31(c31) values (99), (98), (97)", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 4 - request for generated keys after doing an insert into a table with no auto generated keys");
+			System.out.println(" And there has been no one-row insert into a table with auto-generated keys yet.");
+			s.execute("insert into t21 values(23, 'true')", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We should get a resultset with one row of NULL value from getGeneratedKeys");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t21 values(24, 'true')", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(25, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(26, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 5a - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys");
+			s.execute("insert into t11(c11) select c21 from t21", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t11(c11) select c21 from t21", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t11(c11) select c21 from t21", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 5b - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys");
+			s.execute("insert into t11(c11) select c21 from t21 where 1=2", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t11(c11) select c21 from t21 where 1=2", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t11(c11) select c21 from t21 where 1=2", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 5c - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys");
+			s.execute("insert into t11(c11) select c21 from t21 where c21=23", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t11(c11) select c21 from t21 where c21=23", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t11(c11) select c21 from t21 where c21=23", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 6 - request for generated keys after doing a one-row insert into a table with auto generated keys");
+			s.execute("insert into t11(c11) values (99)", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We should get a resultset with one row of non-NULL value");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t11(c11) values (99)", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t11(c11) values (99)", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 7 - Now try again inserting multiple rows into a table with autogenerated key and request generated keys resultset");
+			System.out.println(" This time we will get a row of non-NULL value because there has been a prior one-row insert into table with auto-generated key ");
+			s.execute("insert into t31(c31) values (99), (98), (97)", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t31(c31) values (99), (98), (97)", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t31(c31) values (99), (98), (97)", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 8 - create a new statement and request for generated keys on it after doing an insert into ");
+			System.out.println(" a table with no auto generated keys");
+			Statement s1 = conn.createStatement();
+			s1.execute("insert into t21 values(27, 'true')", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We should get a resultset with one row of non-NULL value");
+			dumpRS(s1.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s1.executeUpdate("insert into t21 values(28, 'true')", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s1.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(29, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(30, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 9 - request for generated keys on a statement which does a update ");
+			s.execute("update t11 set c11=1", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("update t11 set c11=1", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("update t11 set c11=1", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 10 - request for generated keys on a statement which does a delete ");
+			s.execute("delete from t11", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("delete from t11", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("delete from t11", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 11 - do a commit and request for generated keys on a statement which does insert into a table with ");
+			System.out.println(" no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)");
+			conn.commit();
+			s.execute("insert into t21 values(31, 'true')", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t21 values(32, 'true')", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(33, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(34, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 12 - do a rollback and request for generated keys on a statement which does insert into a table with ");
+			System.out.println(" no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)");
+			conn.rollback();
+			s.execute("insert into t21 values(35, 'true')", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("had expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with Statement.executeUpdate. It should behave the same");
+			s.executeUpdate("insert into t21 values(36, 'true')", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.execute. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(37, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			System.out.println("Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same");
+			ps = conn.prepareStatement("insert into t21 values(38, 'true')", Statement.RETURN_GENERATED_KEYS);
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 13 - try savepoint rollback and see what happens to auto generated keys resultset");
+			Savepoint savepoint1;
+			System.out.println("Inside the savepoint unit, issue a one-row insert into a table with auto generated keys");
+			savepoint1 = conn.setSavepoint();
+			s.execute("insert into t11(c11) values (99)", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("We should get a resultset with one row of non-NULL value");
+			dumpRS(s.getGeneratedKeys());
+			System.out.println("Now rollback the savepoint unit, and make sure that autogenerated keys resultset still holds on to ");
+			System.out.println(" value that got set inside the rolled back savepoint unit");
+			conn.rollback(savepoint1);
+			s.execute("insert into t21 values(39, 'true')", Statement.RETURN_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+
+			System.out.println("Test 14 - Look at metadata of a getGeneratedKeys resultset");
+			s = conn.createStatement();
+			s.execute("insert into t31(c31) values (99)", Statement.RETURN_GENERATED_KEYS);
+			ResultSet rs = s.getGeneratedKeys();
+			ResultSetMetaData rsmd = rs.getMetaData();
+			System.out.println("The resultset will have one column only");
+			System.out.println("Found " + rsmd.getColumnCount() + " column in the resultset");
+			System.out.println("Type of the column is " + rsmd.getColumnTypeName(1));
+			System.out.println("Precision of the column is " + rsmd.getPrecision(1));
+			System.out.println("Scale of the column is " + rsmd.getScale(1));
+			dumpRS(rs);
+
+			System.out.println("Test 15 - Can not see the auto generated keys if insert is with NO_GENERATED_KEYS");
+			s = conn.createStatement();
+			s.execute("insert into t31(c31) values (99)", Statement.NO_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t31(c31) values (99)", Statement.NO_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			ps = conn.prepareStatement("insert into t31(c31) values (99)", Statement.NO_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 16 - Can not see the auto generated keys if insert is done jdbc 2.0 way ie with no generated key feature");
+			s.execute("insert into t31(c31) values (99)");
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("insert into t31(c31) values (99)");
+			dumpRS(s.getGeneratedKeys());
+			ps = conn.prepareStatement("insert into t31(c31) values (99)");
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 17 - non-insert with NO_GENERATED_KEYS");
+			s = conn.createStatement();
+			s.execute("update t31 set c31=98", Statement.NO_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("update t31 set c31=98", Statement.NO_GENERATED_KEYS);
+			dumpRS(s.getGeneratedKeys());
+			ps = conn.prepareStatement("update t31 set c31=98", Statement.NO_GENERATED_KEYS);
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+
+			System.out.println("Test 18 - non-insert is done jdbc 2.0 way ie with no generated key feature");
+			s.execute("delete from t31");
+			dumpRS(s.getGeneratedKeys());
+			s.executeUpdate("delete from t31");
+			dumpRS(s.getGeneratedKeys());
+			ps = conn.prepareStatement("delete from t31");
+			ps.execute();
+			dumpRS(ps.getGeneratedKeys());
+			ps.executeUpdate();
+			dumpRS(ps.getGeneratedKeys());
+  }
+
+	public static void negativeTests(Connection con) throws SQLException
+	{
+			Statement s = con.createStatement();
+			PreparedStatement ps;
+			//Test21 - insert select with columnIndexes[] array
+			System.out.println("Test21 - insert select with columnIndexes[] array should fail");
+			int colPositions[] = new int[1];
+      colPositions[0] = 1;
+			try {
+				System.out.println("Try passing array with Statement.execute");
+				s.execute("insert into t11(c11) select c21 from t21", colPositions);
+				System.out.println("ERROR: shouldn't be able to pass array with Statement.execute");
+
+			} catch (SQLException e) {
+				if ((e.getMessage() != null &&
+					 e.getMessage().indexOf("Driver not capable") >= 0)
+					|| (e.getSQLState() != null &&
+						(e.getSQLState().startsWith("0A"))))
+					System.out.println("PASS - expected exception - Feature not implemented");
+				else System.out.println("Unexpected FAILURE at " +e);
+
+			}
+			try {
+				System.out.println("Try passing array with Statement.executeUpdate");
+				s.executeUpdate("insert into t11(c11) select c21 from t21", colPositions);
+				System.out.println("ERROR: shouldn't be able to pass array with Statement.executeUpdate");
+			} catch (SQLException e) {
+				if (e.getSQLState() == null || e.getSQLState().startsWith("0A"))
+					dumpExpectedSQLExceptions(e);
+				else
+					JDBCDisplayUtil.ShowSQLException(System.out,e);
+			}
+
+			System.out.println("Test21ps - insert select with columnIndexes[] array should fail");
+			try {
+				System.out.println("Try passing array with Connection.prepareStatement");
+				ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colPositions);
+				System.out.println("ERROR: shouldn't be able to pass array with Connection.prepareStatement");
+			} catch (SQLException e) {
+				if (e.getSQLState() == null || e.getSQLState().startsWith("0A"))
+					dumpExpectedSQLExceptions(e);
+				else
+					JDBCDisplayUtil.ShowSQLException(System.out,e);
+			}
+
+			//Test22 - insert select with columnNames[] array
+			System.out.println("Test22 - insert select with columnNames[] array should fail");
+			String colNames[] = new String[1];
+      colNames[0] = "C11";
+			try {
+				System.out.println("Try passing array with Statement.execute");
+				s.execute("insert into t11(c11) select c21 from t21", colNames);
+				System.out.println("ERROR: shouldn't be able to pass array with Statement.execute");
+			} catch (SQLException e) {
+				if (e.getSQLState() == null || e.getSQLState().startsWith("0A"))
+					dumpExpectedSQLExceptions(e);
+				else
+					JDBCDisplayUtil.ShowSQLException(System.out,e);
+			}
+			try {
+				System.out.println("Try passing array with Statement.executeUpdate");
+				s.executeUpdate("insert into t11(c11) select c21 from t21", colNames);
+				System.out.println("ERROR: shouldn't be able to pass array with Statement.executeUpdate");
+			} catch (SQLException e) {
+				if (e.getSQLState() == null || e.getSQLState().startsWith("0A"))
+					dumpExpectedSQLExceptions(e);
+				else
+					JDBCDisplayUtil.ShowSQLException(System.out,e);
+			}
+
+			System.out.println("Test22ps - insert select with columnNames[] array should fail");
+			try {
+				System.out.println("Try passing array with Connection.prepareStatement");
+				ps = con.prepareStatement("insert into t11(c11) select c21 from t21", colNames);
+				System.out.println("ERROR: shouldn't be able to pass array with Connection.prepareStatement");
+			} catch (SQLException e) {
+				if (e.getSQLState() == null || e.getSQLState().startsWith("0A"))
+					dumpExpectedSQLExceptions(e);
+				else
+					JDBCDisplayUtil.ShowSQLException(System.out,e);
+			}
+	}
+
+	public static void doTest1920(Statement s, Connection con) throws SQLException
+	{
+			//Test19 - bug 4838 no auto generated key resultset generated for INSERT with
+			//generated keys if server-side methods are invoked.
+			//Adding the tests to try server side methods which toggle the auto generated flag
+			//and make sure we don't loose the client side setting in the process
+			System.out.println("Test19 - fix the no auto generated key resultset generated for INSERT with " +
+			"generated keys if server-side methods are invoked");
+			s.execute("CREATE FUNCTION MMWNI() RETURNS VARCHAR(20) LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.jdbcapi.autoGeneratedJdbc30.MyMethodWithNoInsert' PARAMETER STYLE JAVA READS SQL DATA");
+			con.commit();
+			s.execute("insert into t21 values(40,MMWNI())", Statement.RETURN_GENERATED_KEYS);
+			System.out.println("Back to client side looking for auto generated keys");
+			dumpRS(s.getGeneratedKeys());
+
+			//Verify data in the table
+			dumpRS(s.executeQuery("select count(*) from t21"));
+			s.execute("delete from t11");
+
+			s.execute("DROP FUNCTION MMWNI");
+			con.commit();
+			s.close();
+
+			// Test 20 - BUG 4837 garbage collection of the generated key result sets was closing the activation.
+			System.out.println("Test20 - bug 4837garbage collection of the generated key result sets was closing the activation.");
+			PreparedStatement ps = con.prepareStatement("insert into t11(c11) values(?)", Statement.RETURN_GENERATED_KEYS);
+
+			for (int i = 0; i < 100; i++) {
+				ps.setInt(1, 100+i);
+				ps.executeUpdate();
+
+				ResultSet rs = ps.getGeneratedKeys();
+				while (rs.next()) {
+					rs.getInt(1);
+				}
+				rs.close();
+				con.commit();
+
+				System.runFinalization();
+				System.gc();
+				System.runFinalization();
+				System.gc();
+			}
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/autoGeneratedJdbc30_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+runwithjdk13=false
+runwithibm13=false
+runwithj9=false
+usedefaults=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2485 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.batchUpdate
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.BatchUpdateException;
+import java.sql.Connection;
+import java.sql.CallableStatement;
+import java.sql.Date;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+public class batchUpdate { 
+
+	public static void main(String[] args) {
+		boolean		passed = true;
+		Connection	conn = null;
+    Connection  conn2 = null;
+		try {
+			System.out.println("Test batchUpdate starting");
+
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			conn = ij.startJBMS();
+
+			conn2 = ij.startJBMS();
+            passed = runTests( conn, conn2);
+		} catch (SQLException se) {
+			passed = false;
+			dumpSQLExceptions(se);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception caught in main():\n");
+			System.out.println(e.getMessage());
+			e.printStackTrace();
+			passed = false;
+		}
+
+		if (passed)
+			System.out.println("PASS");
+
+		System.out.println("Test batchUpdate finished");
+  }
+
+    // the runTests method is also used by the wascache/wsc_batchUpdate.java test.
+    public static boolean runTests( Connection conn, Connection conn2)
+    {
+        boolean passed = true;
+		Statement	stmt = null;
+		Statement	stmt2 = null;
+
+        try
+        {
+			conn.setAutoCommit(false);
+            stmt = conn.createStatement();
+			conn2.setAutoCommit(false);
+            stmt2 = conn2.createStatement();
+
+			/* Create the table and do any other set-up */
+			passed = passed && setUpTest(conn, stmt);
+
+			// Positive tests for statement batch update
+			passed = passed && statementBatchUpdatePositive(conn, stmt);
+
+			// Negative tests for statement batch update
+			passed = passed && statementBatchUpdateNegative(conn, stmt, conn2, stmt2);
+
+			// Positive tests for callable statement batch update
+			passed = passed && callableStatementBatchUpdate(conn, stmt);
+
+			// Positive tests for prepared statement batch update
+			passed = passed && preparedStatementBatchUpdatePositive(conn, stmt);
+
+			// Negative tests for prepared statement batch update
+			passed = passed && preparedStatementBatchUpdateNegative(conn, stmt, conn2, stmt2);
+        }            
+        catch (SQLException se)
+        {
+			passed = false;
+			dumpSQLExceptions(se);
+		}
+        catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception caught in main():\n");
+			System.out.println(e.getMessage());
+			e.printStackTrace();
+			passed = false;
+		}
+        finally
+        {
+			/* Test is finished - clean up after ourselves */
+			passed = passed && cleanUp(conn, stmt);
+		}
+        return passed;
+    } // end of runTests
+    
+	static boolean callableStatementBatchUpdate( Connection conn, Statement stmt)
+		throws SQLException
+	{
+		boolean 	passed = true;
+
+    //try callable statements
+    passed = passed && runCallableStatementBatch(conn);
+
+    //try callable statement with output parameters
+    passed = passed && runCallableStatementWithOutputParamBatch(conn);
+
+    return passed;
+  }
+
+
+	/**
+ 	 * Positive tests for statement batch update.
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean statementBatchUpdatePositive( Connection conn, Statement stmt)
+		throws SQLException
+	{
+		boolean 	passed = true;
+
+    //try executing a batch which nothing in it.
+    passed = passed && runEmptyStatementBatch(conn, stmt);
+
+    //try executing a batch which one statement in it.
+    passed = passed && runSingleStatementBatch(conn, stmt);
+
+    //try executing a batch with 3 different statements in it.
+    passed = passed && runMultipleStatementsBatch(conn, stmt);
+
+    //try executing a batch with 1000 statements in it.
+    passed = passed && run1000StatementsBatch(conn, stmt);
+
+    //try batch with autocommit true
+    passed = passed && runAutoCommitTrueBatch(conn, stmt);
+
+    //try clear batch
+    passed = passed && runCombinationsOfClearBatch(conn, stmt);
+
+	// confirm associated parameters run ok with batches
+    passed = passed && checkAssociatedParams(conn, stmt);
+	
+    conn.commit();
+
+    return passed;
+  }
+
+	/**
+ 	 * Negative tests for statement batch update.
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean statementBatchUpdateNegative( Connection conn, Statement stmt,
+    Connection conn2, Statement stmt2) throws SQLException 
+	{
+		boolean 	passed = true;
+
+    //statements which will return a resultset are not allowed in batch update
+    //the following case should throw an exception for select. Below trying
+    //various placements of select statement in the batch, ie as 1st stmt,
+    //nth stat and last stmt
+    passed = passed && runStatementWithResultSetBatch(conn, stmt);
+
+    //try executing a batch with regular statement intermingled.
+    passed = passed && runStatementNonBatchStuffInBatch(conn, stmt);
+
+    //Below trying various placements of overflow update statement in the batch, ie
+    //as 1st stmt, nth stat and last stmt
+    passed = passed && runStatementWithErrorsBatch(conn, stmt);
+
+    //try transaction error, in this particular case time out while getting the lock
+    passed = passed && runTransactionErrorBatch(conn, stmt, conn2, stmt2);
+
+    return passed;
+  }
+
+	/**
+ 	 * Positive tests for prepared statement batch update.
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean preparedStatementBatchUpdatePositive(Connection conn, Statement stmt)
+		throws SQLException 
+	{
+		boolean 	passed = true;
+
+    //try executing a batch which nothing in it.
+    passed = passed && runEmptyValueSetPreparedBatch(conn, stmt);
+
+    //try executing a batch with no parameters.
+    passed = passed && runNoParametersPreparedBatch(conn, stmt);
+
+    //try executing a batch which one parameter set in it.
+    passed = passed && runSingleValueSetPreparedBatch(conn, stmt);
+
+    //try executing a batch with 3 parameter sets in it.
+    passed = passed && runMultipleValueSetPreparedBatch(conn, stmt);
+
+    //try executing a batch with 2 parameter sets in it and they are set to null.
+    passed = passed && runMultipleValueSetNullPreparedBatch(conn, stmt);
+
+    //try executing a batch with 1000 statements in it.
+    passed = passed && run1000ValueSetPreparedBatch(conn, stmt);
+
+    //try executing batches with various rollback and commit combinations.
+    passed = passed && runPreparedStatRollbackAndCommitCombinations(conn, stmt);
+
+    //try prepared statement batch with autocommit true
+    passed = passed && runAutoCommitTruePreparedStatBatch(conn, stmt);
+
+    //try clear batch
+    passed = passed && runCombinationsOfClearPreparedStatBatch(conn, stmt);
+
+    return passed;
+  }
+
+	/**
+ 	 * Negative tests for prepared statement batch update.
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean preparedStatementBatchUpdateNegative(Connection conn, Statement stmt,
+    Connection conn2, Statement stmt2) throws SQLException 
+	{
+		boolean 	passed = true;
+
+    //statements which will return a resultset are not allowed in batch update
+    //the following case should throw an exception for select.
+    passed = passed && runPreparedStmtWithResultSetBatch(conn, stmt);
+
+    //try executing a batch with regular statement intermingled.
+    passed = passed && runPreparedStmtNonBatchStuffInBatch(conn, stmt);
+
+    //Below trying various placements of overflow update statement in the batch
+    passed = passed && runPreparedStmtWithErrorsBatch(conn, stmt);
+
+    //try transaction error, in this particular case time out while getting the lock
+    passed = passed && runTransactionErrorPreparedStmtBatch(conn, stmt, conn2, stmt2);
+
+    return passed;
+  }
+
+
+	static public void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se.printStackTrace();
+			se = se.getNextException();
+		}
+	}
+
+	/**
+	 * Check to make sure that the given SQLException is an exception
+	 * with the expected sqlstate.
+	 *
+	 * @param e		The SQLException to check
+	 * @param SQLState	The sqlstate to look for
+	 *
+	 * @return	true means the exception is the expected one
+	 */
+
+	private static boolean checkException(SQLException e,
+											String SQLState)
+	{
+		String				state;
+		String				nextState;
+		SQLException		next;
+		boolean				passed = true;
+
+		state = e.getSQLState();
+
+
+		if (! SQLState.equals(state)) {
+				System.out.println("FAIL -- unexpected exception " + e +
+					"sqlstate: " + state + SQLState);
+				passed = false;
+			}
+
+		return passed;
+	}
+
+	/**
+	 * Clean up after ourselves when testing is done.
+	 *
+	 * @param conn	The Connection
+	 * @param s		A Statement on the Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean cleanUp(Connection conn, Statement s) {
+    boolean passed = true;
+		try {
+			/* Drop the table we created */
+			if (s != null)
+			{
+				s.execute("drop table t1");
+				s.execute("drop table datetab");
+				s.execute("drop table timetab");
+				s.execute("drop table timestamptab");
+				s.execute("drop table usertypetab");
+				s.execute("drop procedure Integ");
+			}
+
+			/* Close the connection */
+			if (conn != null) {
+				conn.rollback();
+				conn.close();
+			}
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception caught in cleanup()");
+			JDBCDisplayUtil.ShowException(System.out, e);
+			passed = false;
+		}
+
+		return passed;
+	}
+
+  //Below trying placements of overflow update statement in the batch
+  static boolean runPreparedStmtWithErrorsBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+    PreparedStatement pStmt = null;
+
+    stmt.executeUpdate("insert into t1 values(1)");
+
+		try
+		{
+      System.out.println("Negative Prepared Stat: testing overflow as first set of values");
+      pStmt = conn.prepareStatement("update t1 set c1=(? + 1)");
+      pStmt.setInt(1, java.lang.Integer.MAX_VALUE);
+      pStmt.addBatch();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "22003");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount != null) {
+          if (updateCount.length != 0) {
+            System.out.println("ERROR: Overflow is first statement in the batch, so there shouldn't have been any update count");
+            passed = false;
+          }
+        } 
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("ERROR: There should been 1 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      System.out.println("Negative Prepared Stat: testing overflow as nth set of values");
+      pStmt = conn.prepareStatement("update t1 set c1=(? + 1)");
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      pStmt.setInt(1, java.lang.Integer.MAX_VALUE);
+      pStmt.addBatch();
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "22003");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount.length != 1) {
+          System.out.println("ERROR: Overflow is second statement in the batch, so there should have been only 1 update count");
+          passed = false;
+        }
+        for (int i=0; i<updateCount.length; i++) {
+          if (updateCount[i] != 1) {
+            System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+            passed = false;
+          }
+        }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("There should been 1 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying select as the last statement
+      System.out.println("Negative Prepared Stat: testing overflow as last set of values");
+      pStmt = conn.prepareStatement("update t1 set c1=(? + 1)");
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      pStmt.setInt(1, java.lang.Integer.MAX_VALUE);
+      pStmt.addBatch();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		}
+		catch (SQLException sqle) {
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "22003");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount.length != 2) {
+          System.out.println("ERROR: Overflow is last statement in the batch, so there should have been only 2 update count");
+          passed = false;
+        }
+        for (int i=0; i<updateCount.length; i++) {
+          if (updateCount[i] != 1) {
+            System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+            passed = false;
+          }
+        }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("There should been 1 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+    pStmt.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return(passed);
+  }
+
+  //Below trying various placements of overflow update statement in the batch, ie
+  //as 1st stmt, nth stat and last stmt
+  static boolean runStatementWithErrorsBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+    stmt.executeUpdate("insert into t1 values(1)");
+
+		try
+		{
+      //trying select as the first statement
+      System.out.println("Negative Statement: statement testing overflow error as first stat in the batch");
+      stmt.addBatch("update t1 set c1=2147483647 + 1");
+      stmt.addBatch("insert into t1 values(1)");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "22003");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount != null) {
+          if (updateCount.length != 0) {
+            System.out.println("ERROR: Overflow is first statement in the batch, so there shouldn't have been any update count");
+            passed = false;
+          }
+        } 
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("ERROR: There should been 1 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying select as the nth statement
+      System.out.println("Negative Statement: statement testing overflow error as nth stat in the batch");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("update t1 set c1=2147483647 + 1");
+      stmt.addBatch("insert into t1 values(1)");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "22003");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount.length != 1) {
+          System.out.println("ERROR: Update is second statement in the batch, so there should have been only 1 update count");
+          passed = false;
+        }
+        for (int i=0; i<updateCount.length; i++) {
+          if (updateCount[i] != 1) {
+            System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+            passed = false;
+          }
+        }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 2) {
+      System.out.println("There should been 2 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying select as the last statement
+      System.out.println("Negative Statement: statement testing overflow error as last stat in the batch");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("update t1 set c1=2147483647 + 1");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		}
+		catch (SQLException sqle) {
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "22003");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount.length != 2) {
+          System.out.println("ERROR: Update is last statement in the batch, so there should have been only 2 update count");
+          passed = false;
+        }
+        for (int i=0; i<updateCount.length; i++) {
+          if (updateCount[i] != 1) {
+            System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+            passed = false;
+          }
+        }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 4) {
+      System.out.println("There should been 4 rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return(passed);
+  }
+
+  //try transaction error, in this particular case time out while getting the lock
+  static boolean runTransactionErrorPreparedStmtBatch(Connection conn, Statement stmt,
+    Connection conn2, Statement stmt2) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+		try
+		{
+      System.out.println("Negative Prepared Stat: testing transaction error, time out while getting the lock");
+
+      stmt.execute("insert into t1 values(1)");
+      stmt2.execute("insert into t1 values(2)");
+
+      PreparedStatement pStmt1 = conn.prepareStatement("update t1 set c1=3 where c1=?");
+      pStmt1.setInt(1, 2);
+      pStmt1.addBatch();
+
+      PreparedStatement pStmt2 = conn.prepareStatement("update t1 set c1=4 where c1=?");
+      pStmt2.setInt(1, 1);
+      pStmt2.addBatch();
+
+      pStmt1.executeBatch();
+      pStmt2.executeBatch();
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is time out while getting the lock related */
+			passed = passed && checkException(sqle, "40XL1");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount != null) {
+          if (updateCount.length != 0) {
+            System.out.println("ERROR: first statement in the batch caused time out while getting the lock, so there shouldn't have been any update count");
+            passed = false;
+          }
+        }
+      }
+		}
+
+    conn.rollback();
+    conn2.rollback();
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try transaction error, in this particular case time out while getting the lock
+  static boolean runTransactionErrorBatch(Connection conn, Statement stmt,
+    Connection conn2, Statement stmt2) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+		try
+		{
+      System.out.println("Negative Statement: statement testing time out while getting the lock in the batch");
+
+      stmt.execute("insert into t1 values(1)");
+      stmt2.execute("insert into t1 values(2)");
+
+      stmt.addBatch("update t1 set c1=3 where c1=2");
+      stmt2.addBatch("update t1 set c1=4 where c1=1");
+
+      stmt.executeBatch();
+      updateCount = stmt2.executeBatch();
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is time out while getting the lock related */
+			passed = passed && checkException(sqle, "40XL1");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount != null) {
+          if (updateCount.length != 0) {
+            System.out.println("ERROR: first statement in the batch caused time out while getting the lock, so there shouldn't have been any update count");
+            passed = false;
+          }
+        }
+      }
+		}
+
+    conn.rollback();
+    conn2.rollback();
+    stmt.clearBatch();
+    stmt2.clearBatch();
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //statements which will return a resultset are not allowed in batch update
+  //the following case should throw an exception for select.
+  static boolean runPreparedStmtWithResultSetBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+		try
+		{
+      //trying select as the first statement
+      System.out.println("Negative Prepared Stat: testing select in the batch");
+      PreparedStatement pStmt = conn.prepareStatement("select * from t1 where c1=?");
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the ResultSetReturnNotAllowed */
+			passed = passed && checkException(sqle, "X0Y79");
+        if (sqle instanceof BatchUpdateException) {
+          updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+          if (updateCount != null) {
+            if (updateCount.length != 0) {
+              System.out.println("ERROR: Select is first statement in the batch, so there shouldn't have been any update count");
+              passed = false;
+            }
+          }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch with regular statement intermingled.
+  static boolean runPreparedStmtNonBatchStuffInBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+		try
+		{
+      //trying execute in the middle of batch
+      System.out.println("Negative Prepared Stat: testing execute in the middle of batch");
+      PreparedStatement pStmt = conn.prepareStatement("select * from t1 where c1=?");
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      pStmt.execute();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the MIDDLE_OF_BATCH */
+			passed = passed && checkException(sqle, "XJ068");
+			// do clearBatch so we can proceed
+			if (checkException(sqle, "XJ068"))
+        stmt.clearBatch();
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying executeQuery in the middle of batch
+      System.out.println("Negative Prepared Stat: testing executeQuery in the middle of batch");
+      PreparedStatement pStmt = conn.prepareStatement("select * from t1 where c1=?");
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      pStmt.executeQuery();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the MIDDLE_OF_BATCH */
+			passed = passed && checkException(sqle, "XJ068");
+			// do clearBatch so we can proceed
+			if (checkException(sqle, "XJ068"))
+        stmt.clearBatch();
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying executeUpdate in the middle of batch
+      System.out.println("Negative Prepared Stat: testing executeUpdate in the middle of batch");
+      PreparedStatement pStmt = conn.prepareStatement("select * from t1 where c1=?");
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+      pStmt.executeUpdate();
+      updateCount = pStmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the MIDDLE_OF_BATCH */
+			passed = passed && checkException(sqle, "XJ068");
+			// do clearBatch so we can proceed
+			if (checkException(sqle, "XJ068"))
+        stmt.clearBatch();
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //statements which will return a resultset are not allowed in batch update
+  //the following case should throw an exception for select. Below trying
+  //various placements of select statement in the batch, ie as 1st stmt,
+  //nth stat and last stmt
+  static boolean runStatementWithResultSetBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+		try
+		{
+      //trying select as the first statement
+      System.out.println("Negative Statement: statement testing select as first stat in the batch");
+      stmt.addBatch("SELECT * FROM SYS.SYSCOLUMNS");
+      stmt.addBatch("insert into t1 values(1)");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the ResultSetReturnNotAllowed */
+			passed = passed && checkException(sqle, "X0Y79");
+        if (sqle instanceof BatchUpdateException) {
+          updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+          if (updateCount != null) {
+            if (updateCount.length != 0) {
+              System.out.println("ERROR: Select is first statement in the batch, so there shouldn't have been any update count");
+              passed = false;
+            }
+          } 
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying select as the nth statement
+      System.out.println("Negative Statement: statement testing select as nth stat in the batch");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("SELECT * FROM SYS.SYSCOLUMNS");
+      stmt.addBatch("insert into t1 values(1)");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the ResultSetReturnNotAllowed */
+			passed = passed && checkException(sqle, "X0Y79");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount.length != 1) {
+          System.out.println("ERROR: Select is second statement in the batch, so there should have been only 1 update count");
+          passed = false;
+        }
+        for (int i=0; i<updateCount.length; i++) {
+          if (updateCount[i] != 1) {
+            System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+            passed = false;
+          }
+        }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("There should been 1 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying select as the last statement
+      System.out.println("Negative Statement: statement testing select as last stat in the batch");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("SELECT * FROM SYS.SYSCOLUMNS");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the ResultSetReturnNotAllowed */
+			passed = passed && checkException(sqle, "X0Y79");
+      if (sqle instanceof BatchUpdateException) {
+        updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+        if (updateCount.length != 2) {
+          System.out.println("ERROR: Select is last statement in the batch, so there should have been only 2 update count");
+          passed = false;
+        }
+        for (int i=0; i<updateCount.length; i++) {
+          if (updateCount[i] != 1) {
+            System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+            passed = false;
+          }
+        }
+      }
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("There should been 3 row in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    conn.rollback();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch with regular statement intermingled.
+  static boolean runStatementNonBatchStuffInBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+		try
+		{
+      //trying execute after addBatch
+      System.out.println("Negative Statement: statement testing execute in the middle of batch");
+      stmt.addBatch("SELECT * FROM SYS.SYSCOLUMNS");
+      stmt.execute("insert into t1 values(1)");
+      stmt.addBatch("insert into t1 values(1)");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the MIDDLE_OF_BATCH */
+			passed = passed && checkException(sqle, "XJ068");
+			// do clearBatch so we can proceed
+			if (checkException(sqle, "XJ068"))
+        stmt.clearBatch();
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying executeQuery after addBatch
+      System.out.println("Negative Statement: statement testing executeQuery in the middle of batch");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.executeQuery("SELECT * FROM SYS.SYSTABLES");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the MIDDLE_OF_BATCH */
+			passed = passed && checkException(sqle, "XJ068");
+			// do clearBatch so we can proceed
+			if (checkException(sqle, "XJ068"))
+        stmt.clearBatch();
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+		try
+		{
+      //trying executeUpdate after addBatch
+      System.out.println("Negative Statement: statement testing executeUpdate in the middle of batch");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.executeUpdate("insert into t1 values(1)");
+      stmt.addBatch("insert into t1 values(1)");
+      stmt.addBatch("SELECT * FROM SYS.SYSCOLUMNS");
+      updateCount = stmt.executeBatch();
+			passed = false;
+		} catch (SQLException sqle) {
+			/* Check to be sure the exception is the MIDDLE_OF_BATCH */
+			passed = passed && checkException(sqle, "XJ068");
+			// do clearBatch so we can proceed
+			if (checkException(sqle, "XJ068"))
+        stmt.clearBatch();
+		}
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    conn.rollback();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing batches with various rollback and commit combinations.
+  static boolean runPreparedStatRollbackAndCommitCombinations(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Prepared Stat: batch, rollback, batch and commit combinations");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.rollback();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should have been 0 rows");
+      passed = false;
+    }
+    rs.close();
+
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.commit();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 2) {
+      System.out.println("ERROR: There should have been 2 rows");
+      passed = false;
+    }
+    rs.close();
+
+    //try batch and commit
+    System.out.println("Positive Prepared Stat: batch and commit combinations");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.commit();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 4) {
+      System.out.println("ERROR: There should have been 4 rows");
+      passed = false;
+    }
+    rs.close();
+
+    //try batch, batch and rollback
+    System.out.println("Positive Prepared Stat: batch, batch and rollback combinations");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.rollback();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 4) {
+      System.out.println("ERROR: There should have been 4 rows");
+      passed = false;
+    }
+    rs.close();
+
+    //try batch, batch and commit
+    System.out.println("Positive Prepared Stat: batch, batch and commit combinations");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.commit();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 8) {
+      System.out.println("ERROR: There should have been 8 rows");
+      passed = false;
+    }
+    rs.close();
+
+    pStmt.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing batches with various rollback and commit combinations.
+  static boolean runRollbackAndCommitCombinations(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Statement: batch, rollback, batch and commit combinations");
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.rollback();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should have been 0 rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.commit();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 2) {
+      System.out.println("ERROR: There should have been 2 rows");
+      passed = false;
+    }
+    rs.close();
+
+    //try batch and commit
+    System.out.println("Positive Statement: batch and commit combinations");
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.commit();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 4) {
+      System.out.println("ERROR: There should have been 4 rows");
+      passed = false;
+    }
+    rs.close();
+
+    //try batch, batch and rollback
+    System.out.println("Positive Statement: batch, batch and rollback combinations");
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.rollback();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 4) {
+      System.out.println("ERROR: There should have been 4 rows");
+      passed = false;
+    }
+    rs.close();
+
+    //try batch, batch and commit
+    System.out.println("Positive Statement: batch, batch and rollback combinations");
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    conn.commit();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 8) {
+      System.out.println("ERROR: There should have been 8 rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try prepared statement batch with autocommit true
+  static boolean runAutoCommitTruePreparedStatBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+		conn.setAutoCommit(true);
+   //prepared statement batch with autocommit true
+    System.out.println("Positive Prepared Stat: testing batch with autocommit true");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there were 3 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("ERROR: There should been 3 rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+    pStmt.close();
+
+    //turn it true again after the above negative test
+		conn.setAutoCommit(false);
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+    //try batch with autocommit true
+  static boolean runAutoCommitTrueBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+		conn.setAutoCommit(true);
+     //try batch with autocommit true
+    System.out.println("Positive Statement: statement testing batch with autocommit true");
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("insert into t1 values(1)");
+    stmt.addBatch("delete from t1");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there were 3 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<(updateCount.length-1); i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+    if (updateCount[2] != 2) {
+      System.out.println("ERROR: update count for stat 2 should have been 2 but it is " + updateCount[2]);
+      passed = false;
+    }
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    //turn it true again after the above negative test
+		conn.setAutoCommit(false);
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try callable statements with output parameters
+  static boolean runCallableStatementWithOutputParamBatch(Connection conn) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+    System.out.println("Negative Callable Statement: callable statement with output parameters in the batch");
+		Statement s = conn.createStatement();
+
+		s.execute("CREATE PROCEDURE takesString(OUT P1 VARCHAR(40), IN P2 INT) " +
+				"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.takesString'" +
+				" NO SQL LANGUAGE JAVA PARAMETER STYLE JAVA");
+
+  	CallableStatement cs = conn.prepareCall("call takesString(?,?)");
+		try
+		{
+
+		cs.registerOutParameter(1, Types.CHAR);
+		cs.setInt(2, Types.INTEGER);
+    cs.addBatch();
+		System.out.println("FAIL - addBatch() allowed with registered out parameter");
+		passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			// Check to be sure the exception is callback related
+			passed = passed && checkException(sqle, "XJ04C");
+		}
+
+    cs.close();
+				s.execute("drop procedure takesString");
+				s.close();
+    conn.rollback();
+    conn.commit();
+    return passed;
+  }
+
+  //try callable statements
+  static boolean runCallableStatementBatch(Connection conn) throws SQLException {
+    boolean passed = true;
+    int updateCount[] = null;
+    ResultSet rs;
+
+    System.out.println("Positive Callable Statement: statement testing callable statement batch");
+  	CallableStatement cs = conn.prepareCall("insert into t1 values(?)");
+
+	cs.setInt(1, 1);
+    cs.addBatch();
+	cs.setInt(1,2);
+    cs.addBatch();
+	try
+	{
+		passed = passed && executeBatchCallableStatement(cs);
+	}
+	catch (SQLException sqle)
+	{
+		/* Check to be sure the exception is callback related */
+		passed = passed && checkException(sqle, "XJ04C");
+        if (sqle instanceof BatchUpdateException) 
+		{
+			updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+			if (updateCount != null) 
+			{
+				if (updateCount.length != 0) 
+				{
+					System.out.println("ERROR: callable statement has output parameter, so there shouldn't have been any update count");
+              		passed = false;
+            	}
+          	} 
+      	}
+	}
+
+	cleanUpCallableStatement(conn, cs, "t1");
+
+	/* Bug 2813 - verify setXXXX() works with
+	 * Date, Time and Timestamp on CallableStatement.
+	 */
+	cs = conn.prepareCall("insert into datetab values(?)");
+
+	cs.setDate(1, Date.valueOf("1990-05-05"));
+    cs.addBatch();
+	cs.setDate(1,Date.valueOf("1990-06-06"));
+    cs.addBatch();
+	try
+	{
+		passed = passed && executeBatchCallableStatement(cs);
+	}
+	catch (SQLException sqle)
+	{
+		/* Check to be sure the exception is callback related */
+		passed = passed && checkException(sqle, "XJ04C");
+        if (sqle instanceof BatchUpdateException) 
+		{
+			updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+			if (updateCount != null) 
+			{
+				if (updateCount.length != 0) 
+				{
+					System.out.println("ERROR: callable statement has output parameter, so there shouldn't have been any update count");
+              		passed = false;
+            	}
+          	} 
+      	}
+	}
+
+	cleanUpCallableStatement(conn, cs, "datetab");
+ 
+	cs = conn.prepareCall("insert into timetab values(?)");
+
+	cs.setTime(1, Time.valueOf("11:11:11"));
+    cs.addBatch();
+	cs.setTime(1, Time.valueOf("12:12:12"));
+    cs.addBatch();
+	try
+	{
+		passed = passed && executeBatchCallableStatement(cs);
+	}
+	catch (SQLException sqle)
+	{
+		/* Check to be sure the exception is callback related */
+		passed = passed && checkException(sqle, "XJ04C");
+        if (sqle instanceof BatchUpdateException) 
+		{
+			updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+			if (updateCount != null) 
+			{
+				if (updateCount.length != 0) 
+				{
+					System.out.println("ERROR: callable statement has output parameter, so there shouldn't have been any update count");
+              		passed = false;
+            	}
+          	} 
+      	}
+	}
+
+	cleanUpCallableStatement(conn, cs, "timestamptab");
+ 
+	cs = conn.prepareCall("insert into timestamptab values(?)");
+
+	cs.setTimestamp(1, Timestamp.valueOf("1990-05-05 11:11:11.1"));
+    cs.addBatch();
+	cs.setTimestamp(1, Timestamp.valueOf("1992-07-07 12:12:12.2"));
+    cs.addBatch();
+	try
+	{
+		passed = passed && executeBatchCallableStatement(cs);
+	}
+	catch (SQLException sqle)
+	{
+		/* Check to be sure the exception is callback related */
+		passed = passed && checkException(sqle, "XJ04C");
+        if (sqle instanceof BatchUpdateException) 
+		{
+			updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+			if (updateCount != null) 
+			{
+				if (updateCount.length != 0) 
+				{
+					System.out.println("ERROR: callable statement has output parameter, so there shouldn't have been any update count");
+              		passed = false;
+            	}
+          	} 
+      	}
+	}
+
+	cleanUpCallableStatement(conn, cs, "timestamptab");
+
+	// Try with a user type
+	cs = conn.prepareCall("insert into usertypetab values(?)");
+
+	cs.setObject(1, Date.valueOf("1990-05-05"));
+    cs.addBatch();
+	cs.setObject(1,Date.valueOf("1990-06-06"));
+    cs.addBatch();
+	try
+	{
+		passed = passed && executeBatchCallableStatement(cs);
+	}
+	catch (SQLException sqle)
+	{
+		/* Check to be sure the exception is callback related */
+		passed = passed && checkException(sqle, "XJ04C");
+        if (sqle instanceof BatchUpdateException) 
+		{
+			updateCount = ((BatchUpdateException)sqle).getUpdateCounts();
+			if (updateCount != null) 
+			{
+				if (updateCount.length != 0) 
+				{
+					System.out.println("ERROR: callable statement has output parameter, so there shouldn't have been any update count");
+              		passed = false;
+            	}
+          	} 
+      	}
+	}
+
+	cleanUpCallableStatement(conn, cs, "usertypetab");
+ 
+	return passed;
+	}
+
+	private static boolean executeBatchCallableStatement(CallableStatement cs)
+		throws SQLException
+	{
+		boolean passed = true;
+		int updateCount[];
+
+		updateCount = cs.executeBatch();
+		if (updateCount.length != 2)
+		{
+			System.out.println("ERROR: there were 2 statements in the batch");
+			passed = false;
+		}
+		for (int i=0; i<updateCount.length; i++) 
+		{
+			if (updateCount[i] != 1) 
+			{
+				System.out.println("ERROR: update count should have been 1 but it's " + updateCount[i]);
+				passed = false;
+			}
+		}
+
+		return passed;
+	}
+
+	private static void cleanUpCallableStatement(Connection conn, CallableStatement cs, String tableName)
+		throws SQLException
+	{
+		cs.close();
+		conn.rollback();
+		cs = conn.prepareCall("delete from " + tableName);
+		cs.executeUpdate();
+		cs.close();
+		conn.commit();
+	}
+
+  //try combinations of clear batch.
+  static boolean runCombinationsOfClearPreparedStatBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Prepared Stat: add 3 statements, clear batch and execute batch");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 2);
+    pStmt.addBatch();
+    pStmt.setInt(1, 3);
+    pStmt.addBatch();
+    pStmt.clearBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 0) {
+      System.out.println("ERROR: there were 0 statements in the batch");
+      passed = false;
+    }
+    
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table");
+      passed = false;
+    }
+    rs.close();
+
+    System.out.println("Positive Prepared Stat: add 3 statements, clear batch, add 3 and execute batch");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 2);
+    pStmt.addBatch();
+    pStmt.setInt(1, 3);
+    pStmt.addBatch();
+    pStmt.clearBatch();
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 2);
+    pStmt.addBatch();
+    pStmt.setInt(1, 3);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there were 3 statements in the batch");
+      passed = false;
+    }
+    
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("ERROR: There should been 3 rows in the table");
+      passed = false;
+    }
+    rs.close();
+    pStmt.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try combinations of clear batch.
+  static boolean runCombinationsOfClearBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Statement: add 3 statements, clear batch and execute batch");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.clearBatch();
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 0) {
+      System.out.println("ERROR: there were 0 statements in the batch");
+      passed = false;
+    }
+    
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should been no rows in the table");
+      passed = false;
+    }
+    rs.close();
+
+    System.out.println("Positive Statement: add 3 statements, clear batch, add 3 and execute batch");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.clearBatch();
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("insert into t1 values(2)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there were 3 statements in the batch");
+      passed = false;
+    }
+    
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("ERROR: There should been 3 rows in the table");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch with 1000 statements in it.
+  static boolean run1000ValueSetPreparedBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Prepared Stat: 1000 parameter set batch");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    for (int i=0; i<1000; i++){
+      pStmt.setInt(1, 1);
+      pStmt.addBatch();
+    }
+    updateCount = pStmt.executeBatch();
+    
+    if (updateCount.length != 1000) {
+      System.out.println("ERROR: there were 1000 parameter sets in the batch");
+      passed = false;
+    }
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1000) {
+      System.out.println("There should been 1000 rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    pStmt.close();
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch with 1000 statements in it.
+  static boolean run1000StatementsBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Statement: 1000 statements batch");
+    for (int i=0; i<1000; i++){
+      stmt.addBatch("insert into t1 values(1)");
+    }
+    updateCount = stmt.executeBatch();
+    
+    if (updateCount.length != 1000) {
+      System.out.println("ERROR: there were 1000 statements in the batch");
+      passed = false;
+    }
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1000) {
+      System.out.println("There should been 1000 rows in the table, but found " + rs.getInt(1) + " rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch with 3 different parameter sets in it.
+  static boolean runMultipleValueSetPreparedBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    //try prepared statement batch with just one set of values
+    System.out.println("Positive Prepared Stat: set 3 set of parameter values and run the batch");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    pStmt.setInt(1, 2);
+    pStmt.addBatch();
+    pStmt.setInt(1, 3);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there were 3 parameter sets in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    pStmt.close();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("ERROR: There should have been 3 rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch with 3 different statements in it.
+  static boolean runMultipleStatementsBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Statement: testing 2 inserts and 1 update batch");
+    stmt.addBatch("insert into t1 values(2)");
+    stmt.addBatch("update t1 set c1=4");
+    stmt.addBatch("insert into t1 values(3)");
+
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there were 3 statements in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    rs = stmt.executeQuery("select count(*) from t1 where c1=2");
+    rs.next();
+    if(rs.getInt(1) != 0) {
+      System.out.println("ERROR: There should have been 0 rows with c1 = 2");
+      passed = false;
+    }
+    rs.close();
+
+    rs = stmt.executeQuery("select count(*) from t1 where c1=4");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("ERROR: There should have been 1 row with c1 = 4");
+      passed = false;
+    }
+    rs.close();
+
+    rs = stmt.executeQuery("select count(*) from t1 where c1=3");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("ERROR: There should have been 1 row with c1 = 3");
+      passed = false;
+    }
+    rs.close();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 2) {
+      System.out.println("ERROR: There should have been 2 rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try prepared statement batch with just one set of values.
+  static boolean runSingleValueSetPreparedBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    //try prepared statement batch with just one set of values
+    System.out.println("Positive Prepared Stat: set one set of parameter values and run the batch");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    pStmt.setInt(1, 1);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+    if (updateCount.length != 1) {
+      System.out.println("ERROR: there was 1 parameter set in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    pStmt.close();
+    rs = stmt.executeQuery("select count(*) from t1 where c1=1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("ERROR: There should have been one rows with c1 = 1");
+      passed = false;
+    }
+    rs.close();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 1) {
+      System.out.println("ERROR: There should have been 1 row");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try prepared statement batch with just no settable parameters.
+  static boolean runNoParametersPreparedBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    System.out.println("Positive Prepared Stat: no settable parameters");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(5)");
+    pStmt.addBatch();
+    pStmt.addBatch();
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+    if (updateCount.length != 3) {
+      System.out.println("ERROR: there was 3 parameter set in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    pStmt.close();
+    rs = stmt.executeQuery("select count(*) from t1 where c1=5");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("ERROR: There should have been three rows with c1 = 5");
+      passed = false;
+    }
+    rs.close();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 3) {
+      System.out.println("ERROR: There should have been 3 rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+  
+  //try prepared statement batch with just 2 set of values and there value is null. Bug 4002
+  static boolean runMultipleValueSetNullPreparedBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+    ResultSet rs;
+
+    //try prepared statement batch with just one set of values
+    System.out.println("Positive Prepared Stat: set one set of parameter values to null and run the batch");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    pStmt.setNull(1, Types.INTEGER);
+    pStmt.addBatch();
+    pStmt.setNull(1, Types.INTEGER);
+    pStmt.addBatch();
+    updateCount = pStmt.executeBatch();
+    if (updateCount.length != 2) {
+      System.out.println("ERROR: there were 2 parameter set to null in the batch");
+      passed = false;
+    }
+
+    for (int i=0; i<updateCount.length; i++) {
+      if (updateCount[i] != 1) {
+        System.out.println("ERROR: update count for stat " + i + "should have been 1 but it is " + updateCount[i]);
+        passed = false;
+      }
+    }
+
+    pStmt.close();
+    rs = stmt.executeQuery("select count(*) from t1 where c1 is null");
+    rs.next();
+    if(rs.getInt(1) != 2) {
+      System.out.println("ERROR: There should have been two rows with c1 is null");
+      passed = false;
+    }
+    rs.close();
+
+    rs = stmt.executeQuery("select count(*) from t1");
+    rs.next();
+    if(rs.getInt(1) != 2) {
+      System.out.println("ERROR: There should have been 2 rows");
+      passed = false;
+    }
+    rs.close();
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch which single statement in it. Should work.
+  static boolean runSingleStatementBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+
+    System.out.println("Positive Statement: testing 1 statement batch");
+    stmt.addBatch("insert into t1 values(2)");
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length>1) {
+      System.out.println("ERROR: Since this is a single statement, there should have been only one update count");
+      passed = false;
+    }
+
+    if (updateCount[0] != 1) {
+      System.out.println("ERROR: update count should have been 1, instead it is " + updateCount[0]);
+      passed = false;
+    }
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch which nothing in it. Should work.
+  static boolean runEmptyValueSetPreparedBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+
+    //try executing a batch which nothing in it. Should work.
+    System.out.println("Positive Prepared Stat: set no parameter values and run the batch");
+    PreparedStatement pStmt = conn.prepareStatement("insert into t1 values(?)");
+    updateCount = pStmt.executeBatch();
+
+    if (updateCount.length != 0) {
+      System.out.println("ERROR: update count should have been zero");
+      passed = false;
+    }
+
+    pStmt.close();
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+  //try executing a batch which nothing in it. Should work.
+  static boolean runEmptyStatementBatch(Connection conn, Statement stmt) throws SQLException {
+    boolean passed = true;
+    int updateCount[];
+
+    //try executing a batch which nothing in it. Should work.
+    System.out.println("Positive Statement: clear the batch and run the empty batch");
+    stmt.clearBatch();
+    updateCount = stmt.executeBatch();
+
+    if (updateCount.length != 0) {
+      System.out.println("ERROR: Since this is an empty statement, there shouldn't have been any update count");
+      passed = false;
+    }
+
+    stmt.executeUpdate("delete from t1");
+    conn.commit();
+    return passed;
+  }
+
+	/**
+	 * Set up the test.
+	 *
+	 * This method creates the table used by the rest of the test.
+	 *
+	 * @param conn	The Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean setUpTest(Connection conn, Statement stmt)
+					throws SQLException 
+	{
+		boolean	passed = true;
+		int		rows;
+
+		/* Create a table  */
+    stmt.addBatch("create table t1(c1 int)");
+    // stmt.addBatch("create class alias for java.lang.Integer");
+    stmt.addBatch("create procedure Integ() language java parameter style java external name 'java.lang.Integer'");
+    stmt.addBatch("create table datetab(c1 date)");
+    stmt.addBatch("create table timetab(c1 time)");
+    stmt.addBatch("create table timestamptab(c1 timestamp)");
+    stmt.addBatch("create table usertypetab(c1 DATE)");
+    stmt.executeBatch();
+
+
+    conn.commit();
+		return passed;
+	}
+
+	/*
+	** Associated parameters are extra parameters that are created
+	** and associated with the root parameter (the user one) to
+	** improve the performance of like.	  For something like
+	** where c1 like ?, we generate extra 'associated' parameters 
+	** that we use for predicates that we give to the access
+	** manager. 
+	*/
+	static boolean checkAssociatedParams(Connection conn, Statement stmt) throws SQLException 
+	{
+		int i;
+		conn.setAutoCommit(false);
+		System.out.println("Positive Statement: testing associated parameters");
+		stmt.executeUpdate("create table assoc(x char(10) not null primary key, y char(100))");
+		stmt.executeUpdate("create table assocout(x char(10))");
+		PreparedStatement ps = conn.prepareStatement("insert into assoc values (?, 'hello')");
+		for (i = 10; i < 60; i++)
+		{
+			ps.setString(1, new Integer(i).toString());
+			ps.executeUpdate();	
+		}
+
+		ps = conn.prepareStatement("insert into assocout select x from assoc where x like ?");
+		ps.setString(1, "33%");
+		ps.addBatch();
+		ps.setString(1, "21%");
+		ps.addBatch();
+		ps.setString(1, "49%");
+		ps.addBatch();
+		int[] updateCount = ps.executeBatch();
+		if (updateCount.length != 3)
+		{
+			System.out.println("ERROR: unexpected updateCount length "+updateCount.length);
+			conn.rollback();
+			return false;
+		}
+
+    	for (i = 0; i < 3; i++)
+		{
+			if (updateCount[i] != 1)
+			{
+				System.out.println("ERROR: unexpected updateCount["+i+"] value = "+updateCount[i]+".  Expected 1");
+				conn.rollback();
+				return false;
+			}
+		}
+		stmt.execute("select cast(x as int) as myint from assocout order by myint");
+		ResultSet rs = stmt.getResultSet();
+		for (i = 0; rs.next(); i++)
+		{
+			int expect = 0;
+			switch (i)
+			{
+				case 0:
+					expect = 21;
+					break;
+				case 1:
+					expect = 33;
+					break;
+				case 2:
+					expect = 49;
+					break;
+			}
+			if (rs.getInt(1) != expect)
+			{
+				System.out.println("ERROR: didn't find value "+expect+" in assocout table.  It would appear that associated parameters aren't working correctly");
+				conn.rollback();
+				return false;
+			}
+		}
+		stmt.executeUpdate("delete from assocout");
+
+		ps = conn.prepareStatement("insert into assocout select x from assoc where x like ?");
+		ps.setString(1, "3%");
+		ps.addBatch();
+		ps.setString(1, "2%");
+		ps.addBatch();
+		ps.setString(1, "1%");
+		ps.addBatch();
+		updateCount = ps.executeBatch();
+		if (updateCount.length != 3)
+		{
+			System.out.println("ERROR: unexpected updateCount2 length "+updateCount.length);
+			conn.rollback();
+			return false;
+		}
+
+    	for (i = 0; i < 3; i++)
+		{
+			if (updateCount[i] != 10)
+			{
+				System.out.println("ERROR: unexpected updateCount2["+i+"] value = "+updateCount[i]+".  Expected 10");
+				conn.rollback();
+				return false;
+			}
+		}
+
+		stmt.execute("select cast(x as int) as myint from assocout order by myint");
+		rs = stmt.getResultSet();
+		for (i = 10; rs.next(); i++)
+		{
+			if (rs.getInt(1) != i)
+			{
+				System.out.println("ERROR: didn't find value "+i+" in assocout table.  It would appear that associated parameters aren't working correctly");
+				stmt.execute("select x from assocout order by x");
+				dumpRS(stmt.getResultSet());	
+				conn.rollback();
+				return false;
+			}
+		}
+		if (i != 40)
+		{
+			System.out.println("ERROR: expected to get 30 values from assocout, but got "+(i-10)+" instead.  It would appear that associated parameters aren't working correctly");
+			stmt.execute("select x from assocout order by x");
+			dumpRS(stmt.getResultSet());	
+			conn.rollback();
+			return false;
+		}
+		
+		stmt.executeUpdate("delete from assocout");
+
+		ps = conn.prepareStatement("insert into assocout select x from assoc where x like ?");
+		ps.setString(1, "%");
+		ps.addBatch();
+		ps.setString(1, "666666");
+		ps.addBatch();
+		ps.setString(1, "%");
+		ps.addBatch();
+		updateCount = ps.executeBatch();
+		if (updateCount.length != 3)
+		{
+			System.out.println("ERROR: unexpected updateCount2 length "+updateCount.length);
+			conn.rollback();
+			return false;
+		}
+
+		stmt.execute("select count(x) from assocout");
+		rs = stmt.getResultSet();
+		rs.next();
+		if (rs.getInt(1) != 100)
+		{
+			System.out.println("ERROR: count from assocout is not 100 as expected, it is "+rs.getString(1)+".  This is after executing like queries using '%'");
+			stmt.execute("select x from assocout order by x");
+			dumpRS(stmt.getResultSet());	
+			conn.rollback();
+			return false;
+		}
+
+
+		return true;
+	}
+
+	// lifted from the metadata test	
+	private static void dumpRS(ResultSet s) throws SQLException 
+	{
+		if (s == null)
+		{
+			System.out.println("<NULL>");
+			return;
+		}
+
+		ResultSetMetaData rsmd = s.getMetaData();
+
+		// Get the number of columns in the result set
+		int numCols = rsmd.getColumnCount();
+
+		if (numCols <= 0) 
+		{
+			System.out.println("(no columns!)");
+			return;
+		}
+
+		StringBuffer heading = new StringBuffer("\t ");
+		StringBuffer underline = new StringBuffer("\t ");
+
+		int len;
+		// Display column headings
+		for (int i=1; i<=numCols; i++) 
+		{
+			if (i > 1) 
+			{
+				heading.append(",");
+				underline.append(" ");
+			}
+			len = heading.length();
+			heading.append(rsmd.getColumnLabel(i));
+			len = heading.length() - len;
+			for (int j = len; j > 0; j--)
+			{
+				underline.append("-");
+			}
+		}
+		System.out.println(heading.toString());
+		System.out.println(underline.toString());
+		
+	
+		StringBuffer row = new StringBuffer();
+		// Display data, fetching until end of the result set
+		while (s.next()) 
+		{
+			row.append("\t{");
+			// Loop through each column, getting the
+			// column data and displaying
+			for (int i=1; i<=numCols; i++) 
+			{
+				if (i > 1) row.append(",");
+				row.append(s.getString(i));
+			}
+			row.append("}\n");
+		}
+		System.out.println(row.toString());
+		s.close();
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/batchUpdate_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+derby.locks.waitTimeout=20

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,127 @@
+--
+-- test java.sql.Connection.DatabaseMetaData.getBestRowIdentifier()
+--
+
+-- create a java procedure to do the metadata call
+create procedure getBestRowID(in schema_param Char(10), in tableName_param Char(10), in scope_param int, in nullable_param Char(5)) parameter style java reads sql data dynamic result sets 1 language java external name 'org.apache.derbyTesting.functionTests.util.metadataHelperProcs.getBestRowId'; 
+prepare bestrow as 'call getBestRowID(?,?,?,?)';
+
+autocommit off;
+
+-- each one of these have only one choice
+create table t1 (i int not null primary key, j int);
+create table t2 (i int not null unique, j int);
+-- adding not null unique to j - otherwise t2 & t3 would be same.
+create table t3 (i int not null unique, j int not null unique);
+create table t4 (i int, j int);
+create unique index t4i on t4(i);
+create table t5 (i int, j int);
+
+-- result: column i
+execute bestrow using 'values(''APP'',''T1'',0,''true'')';
+
+-- result: column i
+execute bestrow using 'values(''APP'',''T2'',0,''true'')';
+
+-- result: column i
+execute bestrow using 'values(''APP'',''T3'',0,''true'')';
+
+-- result: column i
+execute bestrow using 'values(''APP'',''T4'',0,''true'')';
+
+-- result: columns i and j
+execute bestrow using 'values(''APP'',''T5'',0,''true'')';
+
+rollback work;
+
+-- PK preferred to unique
+create table t6 (i int not null unique, j int not null primary key);
+
+-- result: column j
+execute bestrow using 'values(''APP'',''T6'',0,''true'')';
+
+-- PK preferred to unique index
+create table t7 (i int not null, j int not null primary key);
+create unique index t7i_index on t7(i);
+
+-- result: column j
+execute bestrow using 'values(''APP'',''T7'',0,''true'')';
+
+-- unique con preferred to unique index
+create table t8 (i int not null, j int not null unique);
+create unique index t8i_index on t8(i);
+
+-- result: column j
+execute bestrow using 'values(''APP'',''T8'',0,''true'')';
+
+-- non-unique index just ignored
+create table t9 (i int, j int);
+create index t9i_index on t9(i);
+
+-- result: columns i,j
+execute bestrow using 'values(''APP'',''T9'',0,''true'')';
+
+rollback work;
+
+-- fewer cols unique con still ignored over primary key
+create table t10 (i int unique not null , j int not null , primary key (i,j));
+
+-- result: columns i,j
+execute bestrow using 'values(''APP'',''T10'',0,''true'')';
+
+-- fewer cols unique index still ignored over primary key
+create table t11 (i int not null, j int not null, primary key (i,j));
+create unique index t11i_index on t11(i);
+
+-- result: columns i,j
+execute bestrow using 'values(''APP'',''T11'',0,''true'')';
+
+-- fewer cols unique index still ignored over unique con
+create table t12 (i int not null, j int not null, unique (i,j));
+create unique index t12i_index on t12(i);
+
+-- result: columns i,j
+execute bestrow using 'values(''APP'',''T12'',0,''true'')';
+
+rollback work;
+
+-- REMIND: we aren't handling nullOk flag correctly
+-- we just drop nullable cols, we should skip an answer
+-- that has nullable cols in it instead and look for another one.
+create table t13 (i int not null, j int not null, k int, unique (i,j));
+
+-- result: columns i, j (WRONG) 
+-- the correct answer is k: the non-null columns of the table
+execute bestrow using 'values(''APP'',''T13'',0,''false'')';
+
+-- fewest cols unique con is the one picked of several
+create table t14 (i int not null unique, j int not null, k int, unique (i,j));
+
+-- result: columns i
+execute bestrow using 'values(''APP'',''T14'',0,''true'')';
+
+-- fewest cols unique index is the one picked of several
+create table t15 (i int not null, j int not null, k int);
+create unique index t15ij on t15(i,j);
+create unique index t15i on t15(i);
+
+-- result: columns i
+execute bestrow using 'values(''APP'',''T15'',0,''true'')';
+
+-- we don't do anything with SCOPE except detect bad values
+create table t16 (i int not null primary key, j int);
+
+-- result: columns i
+execute bestrow using 'values(''APP'',''T16'',1,''true'')';
+
+-- result: columns i
+execute bestrow using 'values(''APP'',''T16'',2,''true'')';
+
+-- result: no rows
+execute bestrow using 'values(''APP'',''T16'',-1,''true'')';
+
+-- result: no rows
+execute bestrow using 'values(''APP'',''T16'',3,''true'')';
+
+rollback work;
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/bestrowidentifier_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,13 @@
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+# excluding with JCC because the test includes getCurrentConnection() throughout the test
+database=jdbc:derby:wombat;create=true
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4000 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.blobclob4BLOB
+
+   Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derbyTesting.functionTests.util.Formatters;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.sql.Clob;
+import java.sql.Blob;
+
+import org.apache.derby.tools.ij;
+import java.io.*;
+import java.sql.PreparedStatement;
+import java.util.Properties;
+
+/**
+ * Test of JDBC blob and clob
+ *
+ * @author paulat
+ */
+
+public class blobclob4BLOB { 
+
+	static String[] fileName;
+	static long[] fileLength;
+    static int numFiles;
+    static int numRows;
+    static int numStrings;
+	static String[] unicodeStrings;
+    static int numRowsUnicode;
+    static String unicodeFileName;
+
+	static boolean isDerbyNet = false;
+	static boolean debug = true;
+
+	static
+	{
+		numFiles = 5;
+		fileName = new String[numFiles];
+		fileLength = new long[numFiles];
+
+		fileName[0] = "extin/short.txt";	// set up a short (fit in one page) blob/clob
+		fileName[1] = "extin/littleclob.txt"; // set up a long (longer than a page) blob/clob
+		fileName[2] = "extin/empty.txt"; // set up a blob/clob with nothing in it
+		fileName[3] = "extin/searchclob.txt"; // set up a blob/clob to search with
+		fileName[4] = "extin/aclob.txt"; // set up a really long (over 300K) blob/clob
+
+        numRows = 10;
+
+        numStrings = 3;
+        unicodeStrings = new String[numStrings];
+        unicodeStrings[0] = "\u0061\u0062\u0063";    // abc
+        unicodeStrings[1] = "\u0370\u0371\u0372";
+        unicodeStrings[2] = "\u05d0\u05d1\u05d2";
+        numRowsUnicode = 6;
+
+        unicodeFileName = "extinout/unicodeFile.txt";
+    }
+
+
+	public static void main(String[] args)
+    {
+		System.out.println("Test blobclob starting");
+
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+
+		try
+        {
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			Connection conn = ij.startJBMS();
+            // turn off autocommit, otherwise blobs/clobs cannot hang around
+            // until end of transaction
+            conn.setAutoCommit(false);
+
+            prepareCLOBMAIN(conn);
+            prepareSearchClobTable(conn);
+            prepareUnicodeTable(conn);
+            prepareUnicodeFile(conn);
+            // prepareBinaryTable(conn);
+
+            setCharacterStreamTest(conn);
+
+            // unicodeTest();
+            // clobTestGroupfetch(conn);
+
+            clobTest0(conn);
+			clobTest11(conn);
+			clobTest12(conn);
+			clobTest2(conn);
+            clobTest22(conn);
+            clobTest3(conn);
+            clobTest32(conn);
+            clobTest4(conn);
+            clobTest42(conn);
+			clobTest51(conn);
+			clobTest52(conn);
+			clobTest53(conn);
+			clobTest54(conn);
+            clobTest6(conn);
+            clobTest7(conn);
+
+			clobTest8(conn);
+
+			clobTest91(conn);
+            clobTest92(conn);
+            clobTest93(conn);
+            clobTest94(conn);
+            clobTest95(conn);
+            // restart the connection
+            conn = ij.startJBMS();
+            conn.setAutoCommit(false);
+            clobTest96(conn);
+
+            prepareBlobTable(conn);
+            prepareSearchBlobTable(conn);
+
+            blobTest0(conn);
+			blobTest2(conn);
+            blobTest3(conn);
+            blobTest4(conn);
+            blobTest51(conn);
+            blobTest52(conn);
+            blobTest53(conn);
+            blobTest54(conn);
+            blobTest6(conn);
+            blobTest7(conn);
+			blobTest91(conn);
+            blobTest92(conn);
+            blobTest93(conn);
+            blobTest94(conn);
+            blobTest95(conn);
+            // restart the connection
+            conn = ij.startJBMS();
+            conn.setAutoCommit(false);
+            blobTest96(conn);
+
+            clobTestSelfDestructive(conn);
+            clobTestSelfDestructive2(conn);
+
+            conn.commit();
+            conn.close();
+            System.out.println("FINISHED TEST blobclob :-)");
+
+		}
+        catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+			if (debug) e.printStackTrace();
+		}
+        catch (Throwable e)
+        {
+			System.out.println("xFAIL -- unexpected exception:" + e.toString());
+//            e.fillInStackTrace();
+            if (debug) e.printStackTrace();
+		}
+		System.out.println("Test blobclob finished");
+    }
+
+
+    private static void insertRow(PreparedStatement ps, String s)
+        throws SQLException
+    {
+		ps.clearParameters();
+        ps.setString(1, s);
+        ps.setInt(2, s.length());
+        ps.executeUpdate();
+    }
+
+    private static void insertRow(PreparedStatement ps, String s, int i)
+        throws SQLException
+    {
+        ps.setString(1, s);
+        ps.setInt(2, s.length());
+        ps.setInt(3, i);
+        ps.executeUpdate();
+    }
+
+    private static void insertRow(PreparedStatement ps, byte[] b)
+        throws SQLException
+    {
+        ps.setBytes(1, b);
+        ps.setInt(2, b.length);
+        ps.executeUpdate();
+    }
+
+    /*
+        Set up a table with all kinds of CLOB values,
+        some short (less than 1 page), some long (more than 1 page)
+        some very large (many pages).
+        Table has 2 cols: the first is the value, the second is the length of
+        the value.
+        (Also sets the fileLength array.)
+    */
+    private static void prepareCLOBMAIN(Connection conn)
+    {
+        //System.out.println("prepareCLOBMAIN started");
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute(
+		// creating table small then add large column - that way forcing table to have default small page size, but have large rows.
+                "create table testCLOB_MAIN (b integer)");
+		stmt.execute("alter table testCLOB_MAIN add column a CLOB(1M)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testCLOB_MAIN (a, b) values(?,?)");
+
+            // insert small strings
+			insertRow(ps,"");
+            insertRow(ps,"you can lead a horse to water but you can't form it into beverage");
+            insertRow(ps,"a stitch in time says ouch");
+            insertRow(ps,"here is a string with a return \n character");
+
+
+            // insert larger strings using setAsciiStream
+            for (int i = 0; i < numFiles; i++)
+            {
+                // prepare an InputStream from the file
+                File file = new File(fileName[i]);
+                fileLength[i] = file.length();
+				/*
+				System.out.println("inserting filename[" +i +
+								   "]" + fileName[i] +
+								   " length: " + fileLength[i]);
+				*/
+                InputStream fileIn = new FileInputStream(file);
+
+                System.out.println("===> inserting " + fileName[i] + " length = "
+				    				   + fileLength[i]);
+
+                // insert a streaming column
+				ps.setAsciiStream(1, fileIn, (int)fileLength[i]);
+                ps.setInt(2, (int)fileLength[i]);
+                ps.executeUpdate();
+				ps.clearParameters();
+                fileIn.close();
+            }
+
+            // insert a null
+            ps.setNull(1, Types.CLOB);
+            ps.setInt(2, 0);
+            ps.executeUpdate();
+
+            conn.commit();
+
+            // set numRows
+			rs = stmt.executeQuery("select count(*) from testCLOB_MAIN");
+            int realNumRows = -1;
+			if (rs.next())
+                realNumRows = rs.getInt(1);
+            if (realNumRows <= 0)
+                System.out.println("FAIL. No rows in table testCLOB_MAIN");
+            if (realNumRows != numRows)
+                System.out.println("FAIL. numRows is incorrect");
+
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+			if (debug) e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+        //System.out.println("prepareCLOBMAIN finished");
+    }
+
+
+
+    /*
+        Set up a table with clobs to search for
+        most short (less than 1 page), some long (more than 1 page)
+        some very large (many pages) ??
+    */
+    private static void prepareSearchClobTable(Connection conn)
+    {
+        //System.out.println("prepareSearchClobTable started");
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			// creating table small then add large column - that way forcing table to have default small page size, but have large rows.
+			stmt.execute("create table searchClob (b integer)");
+			stmt.execute("alter table searchClob add column a CLOB(300k)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into searchClob (a, b) values(?,?)");
+            insertRow(ps,"horse");
+            insertRow(ps,"ouch");
+            insertRow(ps,"\n");
+            insertRow(ps,"");
+            insertRow(ps,"Beginning");
+            insertRow(ps,"position-69");
+            insertRow(ps,"I-am-hiding-here-at-position-5910");
+            insertRow(ps,"Position-9907");
+
+            // insert larger strings using setAsciiStream
+            for (int i = 0; i < numFiles; i++)
+            {
+                // prepare an InputStream from the file
+                File file = new File(fileName[i]);
+                fileLength[i] = file.length();
+                InputStream fileIn = new FileInputStream(file);
+
+				/*
+				System.out.println("inserting filename[" +i +
+								   "]" + fileName[i] +
+								   " length: " + fileLength[i]);
+				*/
+                System.out.println("===> inserting " + fileName[i] + " length = "
+				    				   + fileLength[i]);
+
+                // insert a streaming column
+
+                ps.setAsciiStream(1, fileIn, (int)fileLength[i]);
+                ps.setInt(2, (int)fileLength[i]);
+                ps.executeUpdate();
+				ps.clearParameters();
+                fileIn.close();
+            }
+
+            // insert a null
+            ps.setNull(1, Types.CLOB);
+            ps.setInt(2, 0);
+            ps.executeUpdate();
+
+            conn.commit();
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+			if (debug) e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+        //System.out.println("prepareSearchClobTable finished");
+    }
+
+
+    /*
+        Set up a table with unicode strings in it
+        some short (less than 1 page), some long (more than 1 page)
+        Table has 3 cols: the first is the value, the second is the length of
+        the value, the third is the array index (or else -1 for the ones from files).
+        (Also sets the fileLength array.)
+        Try slurping the thing into a String.
+    */
+    private static void prepareUnicodeTable(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			// creating table small then add large column - that way forcing table to have default small page size, but have large rows.
+			stmt.execute("create table testUnicode (b integer, c integer)");
+			stmt.execute("alter table testUnicode add column a CLOB(100k)");
+            PreparedStatement ps = conn.prepareStatement(
+            //    "insert into testUnicode values(?,?,?)");
+                "insert into testUnicode (a, b, c)  values(?,?,?)");
+
+            // insert small strings
+
+            for (int i = 0; i < numStrings; i++)
+            {
+                insertRow(ps,unicodeStrings[i],i);
+            }
+
+            StringBuffer sb = new StringBuffer(5000);
+            for (int i = 0; i < 5000; i++)
+                sb.append('q');
+            String largeString = new String(sb);
+
+            // insert larger strings
+            for (int i = 0; i < numStrings; i++)
+            {
+                insertRow(ps,unicodeStrings[i] + largeString + unicodeStrings[i] + "pppppppppp",i);
+            }
+            conn.commit();
+
+            // set numRows
+			rs = stmt.executeQuery("select count(*) from testUnicode");
+            int realNumRows = -1;
+			if (rs.next())
+                realNumRows = rs.getInt(1);
+            if (realNumRows <= 0)
+                System.out.println("FAIL. No rows in table testUnicode");
+            if (realNumRows != numRowsUnicode)
+                System.out.println("FAIL. numRowsUnicode is incorrect");
+
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+
+    }
+
+
+    /*
+      Tests PreparedStatement.setCharacterStream
+    */
+    private static void setCharacterStreamTest(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			// forcing table with default table space.
+			stmt.execute("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','4096')");
+			stmt.execute("create table testUnicode2 (a CLOB(100k))");
+			stmt.execute("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','0')");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testUnicode2 values(?)");
+
+            // insert large string using setCharacterStream
+            // prepare an InputStream from the file
+            File file = new File(unicodeFileName);
+            InputStream fileIS = new FileInputStream(file);
+            Reader filer = new InputStreamReader(fileIS,"UTF8");
+            // insert a streaming column
+            ps.setCharacterStream(1, filer, 5009);
+            ps.executeUpdate();
+            filer.close();
+            conn.commit();
+
+			rs = stmt.executeQuery("select a from testUnicode2");
+            while (rs.next())
+            {
+                Clob clob = rs.getClob(1);
+                System.out.println("Length of clob is " + clob.length());
+                Reader r = clob.getCharacterStream();
+                char[] buf = new char[3];
+                for (int i = 0; i < numStrings; i++)
+                {
+                    r.read(buf);
+                    if (unicodeStrings[i].equals(new String(buf)))
+                        System.out.println("unicode string " + i + " matched");
+                    else
+                        System.out.println("unicode string " + i + " not matched");
+                }
+                for (int i = 0; i < 5000; i++)
+                {
+                    int c = r.read();
+                    if (c == -1)
+                    {
+                        System.out.println("EOF reached at i = " + i);
+                        break;
+                    }
+                    if ((char)c != 'p')
+                    {
+                        System.out.println("A p was missed, got a " + (char)c);
+                    }
+                }
+                if (r.read() != -1)
+                    System.out.println("EOF was missed");
+                else
+                    System.out.println("EOF matched");
+            }
+            conn.commit();
+
+            System.out.println("setCharacterStreamTest finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+      Make a file with unicode stuff in it.
+     */
+    private static void prepareUnicodeFile(Connection conn)
+    {
+		try
+        {
+            File file = new File(unicodeFileName);
+            OutputStream fos = new FileOutputStream(file);
+            Writer filew = new OutputStreamWriter(fos,"UTF8");
+            // FileWriter filew = new FileWriter(file);
+            filew.write(unicodeStrings[0]);
+            filew.write(unicodeStrings[1]);
+            filew.write(unicodeStrings[2]);
+            for (int i = 0; i < 5000; i++)
+                filew.write('p');
+            filew.close();
+
+            InputStream fis = new FileInputStream(file);
+            Reader filer = new InputStreamReader(fis,"UTF8");
+            // FileReader filer = new FileReader(file);
+            char bufs[][] = new char[numStrings][3];
+            for (int i = 0; i < numStrings; i++)
+            {
+                filer.read(bufs[i]);
+                String s = new String(bufs[i]);
+                if (s.equals(unicodeStrings[i]))
+                    System.out.println("unicode string " + i + " correct");
+                else
+                    System.out.println("FAILED: unicode string " + i + " incorrect");
+            }
+            for (int i = 0; i < 5000; i++)
+                if (filer.read() != 'p')
+                    System.out.println("Not a p : i = " + i);
+            if (filer.read() != -1)
+                System.out.println("Not EOF");
+            filer.close();
+            System.out.println("Finished prepareUnicodeFile");
+        }
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+    /*
+        basic test of getAsciiStream
+        also tests length
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest0(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			byte[] buff = new byte[128];
+			// fetch row back, get the column as a clob.
+            Clob clob;
+            int clobLength, i = 0;
+			while (rs.next()) {
+                i++;
+				// get the first column in select as a clob
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+				InputStream fin = clob.getAsciiStream();
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+                clobLength = rs.getInt(2);
+
+                if (columnSize != clobLength)
+					System.out.println("test failed, columnSize should be " + clobLength
+					   + ", but it is " + columnSize + ", i = " + i);
+                if (columnSize != clob.length())
+				{
+					System.out.println("test failed, clob.length() should be " +  columnSize
+					   + ", but it is " + clob.length() + ", i = " + i);
+				}
+			}
+			
+            conn.commit();
+            System.out.println("clobTest0 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        basic test of getCharacterStream
+        also tests length
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest11(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			met = rs.getMetaData();
+			char[] buff = new char[128];
+			// fetch row back, get the column as a clob.
+            int i = 0, clobLength = 0;
+			while (rs.next()) {
+                i++;
+				// get the first column as a clob
+                Clob clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+				Reader reader = clob.getCharacterStream();
+				int columnSize = 0;
+				for (;;) {
+					int size = reader.read(buff);
+					if (size == -1)
+						break;
+                    // System.out.println("the next buffer is :" + buff);
+					columnSize += size;
+				}
+                clobLength = rs.getInt(2);
+                if (columnSize != clobLength)
+					System.out.println("test failed, columnSize should be " + clobLength
+					   + ", but it is " + columnSize + ", i = " + i);
+                if (columnSize != clob.length())
+					System.out.println("test failed, clob.length() should be " +  columnSize
+					   + ", but it is " + clob.length() + ", i = " + i);
+				
+			}
+            conn.commit();
+            System.out.println("clobTest11 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+            if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test of getCharacterStream on a table containing unicode characters
+        need to run prepareUnicodeTable first
+     */
+	private static void clobTest12(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b,c from testUnicode");
+            int i = 0, colLength = 0, arrayIndex = 0;
+			while (rs.next())
+            {
+                i++;
+                colLength = rs.getInt(2);
+                arrayIndex = rs.getInt(3);
+                Clob clob = rs.getClob(1);
+                if (clob == null)
+                {
+                    System.out.println("row " + i + " is null, skipped");
+                    continue;
+                }
+                Reader reader = clob.getCharacterStream();
+
+				int columnSize = 0, c;
+                String compareString = "";
+				for (;;)
+                {
+					c = reader.read();
+					if (c == -1)
+						break;
+                    if (columnSize < 3)
+                        compareString += (char)c;
+					columnSize ++;
+				}
+                if (compareString.equals(unicodeStrings[arrayIndex]))
+                    System.out.println("Succeeded to match, row " + i);
+                else
+                {
+                    System.out.println("Failed to match, row " + i +
+                    ". compareString = " + compareString + ". arrayIndex = " +
+                    arrayIndex + ". unicodeStrings[arrayIndex] = " +
+                    unicodeStrings[arrayIndex]);
+
+                }
+                if (columnSize != colLength)
+					System.out.println("test failed, columnSize should be " + colLength
+					   + ", but it is " + columnSize + ", i = " + i);
+                else
+                    System.out.println("PASSED, row " + i + ", length was " + columnSize);
+			}
+            conn.commit();
+            System.out.println("clobTest12 finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+            if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+
+
+    /*
+    test getSubString
+    need to run prepareCLOBMAIN first
+    */
+	private static void clobTest2(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+            int i = 0, clobLength = 0;
+            Clob clob;
+			while (rs.next())
+            {
+                i++;
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+                clobLength = rs.getInt(2);
+                blobclob4BLOB.printInterval(clob, 9905, 50, 0, i, clobLength);
+                blobclob4BLOB.printInterval(clob, 5910, 150, 1, i, clobLength);
+                blobclob4BLOB.printInterval(clob, 5910, 50, 2, i, clobLength);
+                blobclob4BLOB.printInterval(clob, 204, 50, 3, i, clobLength);
+                blobclob4BLOB.printInterval(clob, 68, 50, 4, i, clobLength);
+                blobclob4BLOB.printInterval(clob, 1, 50, 5, i, clobLength);
+                blobclob4BLOB.printInterval(clob, 1, 1, 6, i, clobLength);
+                /*
+                System.out.println(i + "(0) " + clob.getSubString(9905,50));
+                System.out.println(i + "(1) " + clob.getSubString(5910,150));
+                System.out.println(i + "(2) " + clob.getSubString(5910,50));
+                System.out.println(i + "(3) " + clob.getSubString(204,50));
+                System.out.println(i + "(4) " + clob.getSubString(68,50));
+                System.out.println(i + "(5) " + clob.getSubString(1,50));
+                System.out.println(i + "(6) " + clob.getSubString(1,1));
+                */
+                if (clobLength > 100)
+                {
+                    String res = clob.getSubString(clobLength-99,200);
+                    System.out.println(i + "(7) ");
+                    if (res.length() != 100)
+                        System.out.println("FAIL : length of substring is " +
+                            res.length() + " should be 100");
+                    else
+                        System.out.println(res);
+                }
+            }
+            System.out.println("clobTest2 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test getSubString with unicode
+    need to run prepareUnicodeTable first
+    */
+	private static void clobTest22(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b,c from testUnicode");
+            int i = 0, clobLength = 0, arrayIndex = 0;
+            Clob clob;
+			while (rs.next())
+            {
+                i++;
+                System.out.print("Row " + i + " : ");
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+                clobLength = rs.getInt(2);
+                arrayIndex = rs.getInt(3);
+                if (clob.getSubString(1,3).equals(unicodeStrings[arrayIndex]))
+                    System.out.println("Succeeded");
+                else
+                    System.out.println("Failed");
+                if (clobLength > 5000)
+                {
+                    if (clob.getSubString(5004,3).equals(unicodeStrings[arrayIndex]))
+                        System.out.println("Second time Succeeded");
+                    else
+                        System.out.println("Second time Failed");
+                }
+            }
+            System.out.println("clobTest22 finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+    /*
+    test position with a String argument
+    need to run prepareCLOBMAIN first
+    */
+	private static void clobTest3(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+            int i = 0, clobLength = 0;
+            Clob clob;
+			while (rs.next())
+            {
+                i++;
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+               clobLength = rs.getInt(2);
+                if (clobLength > 20000)
+                    continue;
+                blobclob4BLOB.printPosition(i,"horse",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"ouch",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"\n",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"Beginning",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"Beginning",2,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"position-69",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"This-is-position-204",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"I-am-hiding-here-at-position-5910",1,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"I-am-hiding-here-at-position-5910",5910,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"I-am-hiding-here-at-position-5910",5911,clob, clobLength);
+                blobclob4BLOB.printPosition(i,"Position-9907",1,clob, clobLength);
+            }
+            System.out.println("clobTest3 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test position with a unicode String argument
+    need to run prepareUnicodeTable first
+    */
+	private static void clobTest32(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b,c from testUnicode");
+            int i = 0, clobLength = 0, arrayIndex = 0;
+            long pos = 0;
+            Clob clob;
+			while (rs.next())
+            {
+                i++;
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+                clobLength = rs.getInt(2);
+                arrayIndex = rs.getInt(3);
+
+                pos = clob.position(unicodeStrings[arrayIndex],1);
+                if (pos == 1)
+                    System.out.println("Succeeded: Found unicode string " + arrayIndex +
+                    " at position " + pos + ",row " + i);
+                else
+                    System.out.println("Failed: Found unicode string " + arrayIndex +
+                    " at position " + pos + ",row " + i);
+
+                pos = clob.position(unicodeStrings[arrayIndex],4000);
+                if (pos == 5004 || (pos == -1 && clobLength < 4000))
+                    System.out.println("Succeeded: Found unicode string " + arrayIndex +
+                    " at position " + pos + ",row " + i);
+                else
+                    System.out.println("Failed: Found unicode string " + arrayIndex +
+                    " at position " + pos + ",row " + i);
+            }
+            System.out.println("clobTest32 finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test position with a Clob argument
+    need to run prepareCLOBMAIN and prepareSearchClobTable first
+    */
+	private static void clobTest4(Connection conn)
+    {
+		ResultSet rs, rs2;
+		Statement stmt, stmt2;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+            int i = 0, clobLength = 0;
+            Clob clob;
+			while (rs.next())
+            {
+                i++;
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+                clobLength = rs.getInt(2);
+                if (clobLength > 20000)
+                    {
+                        System.out.println("testCLOB_MAIN row " + i + " skipped (too large)");
+                        continue;
+                    }
+                // inner loop over table of clobs to search for
+                // clobs
+			    stmt2 = conn.createStatement();
+			    rs2 = stmt2.executeQuery("select a,b from searchClob");
+                int j = 0, clobLength2 = 0;
+                Clob searchClob;
+                String searchStr;
+			    while (rs2.next())
+                {
+                    j++;
+                    searchClob = rs2.getClob(1);
+                    if (searchClob == null)
+                        continue;
+                    clobLength2 = rs2.getInt(2);
+                    if (clobLength2 > 20000)
+                    {
+                        System.out.println("searchClob row " + j + " skipped (too large)");
+                        continue;
+                    }
+                    if (clobLength2 < 150)
+                        searchStr = rs2.getString(1);
+                    else
+                        searchStr = null;
+
+                    printPositionClob(i,searchStr,1,clob,j,searchClob);
+                }
+            }
+            System.out.println("clobTest4 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+			if (debug) e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test position with a Clob argument containing unicode characters
+    need to run prepareCLOBMAIN and prepareSearchClobTable first
+    */
+	private static void clobTest42(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b,c from testUnicode");
+            Clob[] clobArray = new Clob[numRowsUnicode];
+            int i = 0;
+            long pos = 0;
+			while (rs.next())
+            {
+                clobArray[i++] = rs.getClob(1);
+            }
+
+            for (int j = 0; j < 3; j++)
+            {
+                pos = clobArray[j+3].position(clobArray[j],1);
+                if (pos == 1)
+                    System.out.println("Succeeded: Found clob at position " + pos + ",row " + j);
+                else
+                    System.out.println("Failed: Found clob at position " + pos + ",row " + j);
+                // pos = clobArray[i*2].position(clobArray[i*3],1);
+            }
+            System.out.println("clobTest42 finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+    private static void printPositionClob(
+        int rowNum,
+        String searchStr,
+        long position,
+        Clob clob,
+        int searchRowNum,
+        Clob searchClob)
+    {
+        try
+        {
+            long result = clob.position(searchClob,position);
+            if ("".equals(searchStr) && (result == 1)) {
+				System.out.println("position(clob) FOUND @ 1 with empty search clob in clob of length " + clob.length());
+                return;
+			}
+            if (result != -1)
+            {
+                System.out.print("Found ");
+                if (searchStr != null)
+                    System.out.print(searchStr);
+                else
+                    System.out.print("clob (row " + searchRowNum + ") ");
+                System.out.println(" in row " + rowNum + " at position " + result);
+            }
+			else {
+				System.out.println("position(clob) NOT FOUND " + rowNum + " searchStr " +
+					(searchStr != null ? searchStr : ">150chars"));
+			}
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+    }
+
+
+    /* datatype tests */
+
+    // make sure clobs work for small CLOB fields
+    // also test length method
+	private static void clobTest51(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testCLOB10 (a CLOB(10))");
+
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testCLOB10 values(?)");
+            String val = "";
+            for (int i = 0; i < 10; i++)
+            {
+                // insert a string
+                ps.setString(1, val);
+                ps.executeUpdate();
+                val += "x";
+            }
+
+			rs = stmt.executeQuery("select a from testCLOB10");
+			met = rs.getMetaData();
+			byte[] buff = new byte[128];
+            int j = 0;
+			// fetch all rows back, get the columns as clobs.
+			while (rs.next())
+            {
+				// get the first column as a clob
+                Clob clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+				InputStream fin = clob.getAsciiStream();
+				int columnSize = 0;
+				for (;;)
+                {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+                if (columnSize != j)
+                    System.out.println("FAIL - Expected clob size : " + j +
+                        " Got clob size : " + columnSize);
+                if (clob.length() != j)
+                    System.out.println("FAIL - Expected clob length : " + j +
+                        " Got clob length : " + clob.length());
+                j++;
+			}
+            System.out.println("clobTest51 finished");
+        }
+		catch (SQLException e) {
+			if (isDerbyNet)
+				System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+			else
+				TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+   // make sure cannot get a clob from an int column
+	private static void clobTest52(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			System.out.println("create table testInteger (a integer)");
+			stmt.execute("create table testInteger (a integer)");
+
+            int i = 1;
+            System.out.println("insert into testInteger values('158')");
+            PreparedStatement ps = conn.prepareStatement("insert into testInteger values(158)");
+            ps.executeUpdate();
+
+			System.out.println("select a from testInteger");
+			rs = stmt.executeQuery("select a from testInteger");
+			met = rs.getMetaData();
+			while (rs.next()) {
+				// get the first column as a clob
+				System.out.println("getClob(1)");
+                Clob clob = rs.getClob(1);
+                if (clob == null)
+                    System.out.println("clob is null");
+                else
+                    System.out.println("clob is not null");
+			}
+            System.out.println("clobTest52 finished");
+        }
+		catch (SQLException e) {
+			System.out.println("52: SQLException");
+			if (isDerbyNet)
+				System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+			else
+				TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("52: Throwable");
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+   // test creating a clob column, currently this doesn't work since we don't
+   // have a clob datatype (get a syntax error on the create table statement) 
+	private static void clobTest53(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testClobColumn (a clob(1K))");
+
+            System.out.println("clobTest53 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    
+    /*
+        make sure setClob doesn't work on an int column
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest54(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt1, stmt2;
+        try
+        {
+			System.out.println("start clobTest54");
+			stmt1 = conn.createStatement();
+			stmt1.execute("create table testClob2 (a integer, b integer)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testClob2 values(?,?)");
+			stmt2 = conn.createStatement();
+			rs = stmt2.executeQuery("select a,b from testCLOB_MAIN");
+            Clob clob;
+            int clobLength;
+			while (rs.next())
+            {
+				// get the first ncolumn as a clob
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+                clobLength = rs.getInt(2);
+                ps.setClob(1,clob);
+                ps.setInt(2,clobLength);
+                ps.executeUpdate();
+			}
+            rs.close();
+            conn.commit();
+
+            System.out.println("clobTest54 finished");
+        }
+		catch (SQLException e) {
+			// Can't do a setClob on an int column. This is expected
+				TestUtil.dumpSQLExceptions(e,true);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+		System.out.println("end clobTest54");
+    }
+
+
+    /*
+    test raising of exceptions
+    need to run prepareCLOBMAIN first
+    */
+	private static void clobTest6(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+            int i = 0, clobLength = 0;
+            Clob clob;
+			rs.next();
+            clob = rs.getClob(1);
+            if (clob == null)
+                return;
+            clobLength = rs.getInt(2);
+            // 0 or negative position value
+			if (isDerbyNet)
+				System.out.println(" negative tests for clob.getSubstring won't run  for network server  until 5243 is fixed");
+			if (! isDerbyNet)
+			{
+
+				try
+				{
+					clob.getSubString(0,5);
+					System.out.println("FAIL = clob.getSubString(0,5)");
+				}
+				catch (SQLException e)
+				{
+				boolean isExpected = isOutOfBoundException(e);
+													   
+                TestUtil.dumpSQLExceptions(e, isExpected);
+				}
+			
+            // negative length value
+            try
+            {
+                clob.getSubString(1,-76);
+				System.out.println("FAIL = getSubString(1,-76)");
+            }
+            catch (SQLException e)
+            {
+                TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
+            }
+            // zero length value
+            try
+            {
+                clob.getSubString(1,0);
+ 				System.out.println("FAIL = getSubString(1,0)");
+           }
+            catch (SQLException e)
+            {
+                TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
+            }
+            // 0 or negative position value
+            try
+            {
+                clob.position("xx",-4000);
+				System.out.println("FAIL = position('xx',-4000)");
+            }
+            catch (SQLException e)
+            {
+                TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
+            }
+            // null pattern
+            try
+            {
+                clob.position((String) null,5);
+				System.out.println("FAIL = position((String) null,5)");
+            }
+            catch (SQLException e)
+            {
+                TestUtil.dumpSQLExceptions(e, "XJ072".equals(e.getSQLState()));
+            }
+            // 0 or negative position value
+            try
+            {
+                clob.position(clob,-42);
+				System.out.println("FAIL = position(clob,-42)");
+            }
+            catch (SQLException e)
+            {
+                TestUtil.dumpSQLExceptions(e, isOutOfBoundException(e));
+            }
+            // null pattern
+            try
+            {
+                clob.position((Clob) null,5);
+				System.out.println("FAIL = pposition((Clob) null,5)");
+            }
+            catch (SQLException e)
+            {
+                TestUtil.dumpSQLExceptions(e, "XJ072".equals(e.getSQLState()));
+            }
+            System.out.println("clobTest6 finished");
+			}
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test setClob
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest7(Connection conn)
+    {
+		ResultSet rs, rs2;
+		Statement stmt1, stmt2;
+
+		System.out.println("start clobTest7");
+        try
+        {
+			stmt1 = conn.createStatement();
+			stmt1.execute("create table testClob7 (a CLOB(300k), b integer)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testClob7 values(?,?)");
+			stmt2 = conn.createStatement();
+			rs = stmt2.executeQuery("select a,b from testCLOB_MAIN");
+            Clob clob;
+            int clobLength;
+			int rownum = 0;
+			while (rs.next())
+            {
+				// get the first column as a clob
+                clob = rs.getClob(1);
+                if (clob == null)
+                    continue;
+                clobLength = rs.getInt(2);
+                ps.setClob(1,clob);
+                ps.setInt(2,clobLength);
+                ps.executeUpdate();
+			}
+            rs.close();
+            conn.commit();
+
+			rs2 = stmt2.executeQuery("select a,b from testClob7");
+            Clob clob2;
+            int clobLength2, j = 0;
+			while (rs2.next())
+            {
+                j++;
+				// get the first column as a clob
+                clob2 = rs2.getClob(1);
+                if (clob2 == null)
+                    continue;
+                clobLength2 = rs2.getInt(2);
+                if (clob2.length() != clobLength2)
+                    System.out.println("FAILED at row " + j);
+			}
+            rs2.close();
+
+            conn.commit();
+            System.out.println("clobTest7 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+			if (debug) e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+	/**
+		Agressive test of position. 
+	*/
+  	private static void clobTest8(Connection conn)
+    {
+		System.out.println("start clobTest8");
+		try {
+			Statement s = conn.createStatement();
+
+			s.execute("CREATE TABLE C8.T8POS(id INT NOT NULL PRIMARY KEY, DD CLOB(1m), pos INT, L INT)");
+			s.execute("CREATE TABLE C8.T8PATT(PATT CLOB(300k))");
+
+			// characters used to fill the String
+			char[] fill = new char[4];
+			fill[0] = 'd';		// 1 byte UTF8 character (ASCII)
+			fill[1] = '\u03a9';  // 2 byte UTF8 character (Greek)
+			fill[2] = '\u0e14'; // 3 byte UTF8 character (Thai)
+			fill[3] = 'j';		// 1 byte UTF8 character (ASCII)
+
+			char[] base = new char[256 * 1024];
+
+			for (int i = 0; i < base.length; i += 4) {
+
+				base[i] = fill[0];
+				base[i+1] = fill[1];
+				base[i+2] = fill[2];
+				base[i+3] = fill[3];
+
+			}
+
+			char[]  patternBase = new char[2 * 1024];
+			for (int i = 0; i < patternBase.length; i += 8) {
+
+				patternBase[i] = 'p';
+				patternBase[i+1] = 'a';
+				patternBase[i+2] = 't';
+				patternBase[i+3] = '\u03aa';
+				patternBase[i+4] = (char) i;   // changed value to keep pattern varyinh
+				patternBase[i+5] = 'b';
+				patternBase[i+6] = 'm';
+				patternBase[i+7] = '\u0e15';
+
+			}
+
+			PreparedStatement ps = conn.prepareStatement("INSERT INTO C8.T8POS VALUES (?, ?, ?, ?)");
+			PreparedStatement psp = conn.prepareStatement("INSERT INTO C8.T8PATT VALUES (?)");
+
+			T8insert(ps, 1, base, 256, patternBase, 8, 100, true);
+			T8insert(ps, 2, base, 3988, patternBase, 8, 2045, true);
+			T8insert(ps, 3, base, 16321, patternBase, 8, 4566, true);
+			T8insert(ps, 4, base, 45662, patternBase, 8, 34555, true);
+			T8insert(ps, 5, base, 134752, patternBase, 8, 67889, true);
+			T8insert(ps, 6, base, 303, patternBase, 8, 80, false);
+			T8insert(ps, 7, base, 4566, patternBase, 8, 2086, false);
+			T8insert(ps, 8, base, 17882, patternBase, 8, 4426, false);
+			T8insert(ps, 9, base, 41567, patternBase, 8, 31455, false);
+			String pstr = T8insert(ps, 10, base, 114732, patternBase, 8, 87809, false);			
+
+			conn.commit();
+
+			psp.setString(1, pstr);
+			psp.executeUpdate();
+
+			System.out.println("small string pattern");
+			checkClob8(s, pstr);
+			conn.commit();
+
+			System.out.println("small java.sql.Clob pattern");
+			ResultSet rsc = s.executeQuery("SELECT PATT FROM C8.T8PATT");
+			rsc.next();
+			checkClob8(s, rsc.getClob(1));
+
+			rsc.close();
+
+
+			conn.commit();
+
+			s.execute("DELETE FROM C8.T8POS");
+			s.execute("DELETE FROM C8.T8PATT");
+
+
+			T8insert(ps, 1, base, 256, patternBase, 134, 100, true);
+			T8insert(ps, 2, base, 3988, patternBase, 134, 2045, true);
+			T8insert(ps, 3, base, 16321, patternBase, 134, 4566, true);
+			T8insert(ps, 4, base, 45662, patternBase, 134, 34555, true);
+			T8insert(ps, 5, base, 134752, patternBase, 134, 67889, true);
+			T8insert(ps, 6, base, 303, patternBase, 134, 80, false);
+			T8insert(ps, 7, base, 4566, patternBase, 134, 2086, false);
+			T8insert(ps, 8, base, 17882, patternBase, 134, 4426, false);
+			T8insert(ps, 9, base, 41567, patternBase, 134, 31455, false);
+			pstr = T8insert(ps, 10, base, 114732, patternBase, 134, 87809, false);
+
+			conn.commit();
+			psp.setString(1, pstr);
+			psp.executeUpdate();
+			conn.commit();
+
+
+			System.out.println("medium string pattern");
+			checkClob8(s, pstr);
+			conn.commit();
+
+			System.out.println("medium java.sql.Clob pattern");
+			rsc = s.executeQuery("SELECT PATT FROM C8.T8PATT");
+			rsc.next();
+			checkClob8(s, rsc.getClob(1));
+
+			s.execute("DELETE FROM C8.T8POS");
+			s.execute("DELETE FROM C8.T8PATT");
+
+			T8insert(ps, 1, base, 256, patternBase, 679, 100, true);
+			T8insert(ps, 2, base, 3988, patternBase, 679, 2045, true);
+			T8insert(ps, 3, base, 16321, patternBase, 679, 4566, true);
+			T8insert(ps, 4, base, 45662, patternBase, 679, 34555, true);
+			T8insert(ps, 5, base, 134752, patternBase, 679, 67889, true);
+			T8insert(ps, 6, base, 303, patternBase, 679, 80, false);
+			T8insert(ps, 7, base, 4566, patternBase, 679, 2086, false);
+			T8insert(ps, 8, base, 17882, patternBase, 679, 4426, false);
+			T8insert(ps, 9, base, 41567, patternBase, 679, 31455, false);
+			pstr = T8insert(ps, 10, base, 114732, patternBase, 679, 87809, false);
+
+			conn.commit();
+			psp.setString(1, pstr);
+			psp.executeUpdate();
+			conn.commit();
+
+
+			System.out.println("long string pattern");
+			checkClob8(s, pstr);
+			conn.commit();
+
+			System.out.println("long java.sql.Clob pattern");
+			rsc = s.executeQuery("SELECT PATT FROM C8.T8PATT");
+			rsc.next();
+			checkClob8(s, rsc.getClob(1));
+
+			s.execute("DELETE FROM C8.T8POS");
+			s.execute("DELETE FROM C8.T8PATT");
+			ps.close();
+			psp.close();
+			// 
+
+			s.execute("DROP TABLE C8.T8POS");
+			s.execute("DROP TABLE C8.T8PATT");
+
+			s.close();
+
+			conn.commit();
+
+			System.out.println("complete clobTest8");
+
+
+		} catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			e.printStackTrace(System.out);
+		}
+	}
+
+	private static void checkClob8(Statement s, String pstr) throws SQLException {
+		ResultSet rs = s.executeQuery("SELECT ID, DD, POS, L FROM C8.T8POS ORDER BY 1");
+
+		while (rs.next()) {
+
+			int id = rs.getInt(1);
+
+			System.out.print("@" + id + " ");
+
+			java.sql.Clob cl = rs.getClob(2);
+
+			int pos = rs.getInt(3);
+			int len = rs.getInt(4);
+
+			long clobPosition = cl.position(pstr, 1);
+			if (clobPosition == (long) pos) {
+				System.out.print(" position MATCH("+pos+")");
+			} else {
+				System.out.print(" position FAIL("+clobPosition+"!=" + pos +")");
+			}
+
+			System.out.println("");
+		}
+		rs.close();
+	}
+	private static void checkClob8(Statement s, Clob pstr) throws SQLException {
+		ResultSet rs = s.executeQuery("SELECT ID, DD, POS, L FROM C8.T8POS ORDER BY 1");
+
+		while (rs.next()) {
+
+			int id = rs.getInt(1);
+
+			System.out.print("@" + id + " ");
+
+			java.sql.Clob cl = rs.getClob(2);
+
+			int pos = rs.getInt(3);
+			int len = rs.getInt(4);
+
+			long clobPosition = cl.position(pstr, 1);
+			if (clobPosition == (long) pos) {
+				System.out.print(" position MATCH("+pos+")");
+			} else {
+				System.out.print(" position FAIL("+clobPosition+"!=" + pos +")");
+			}
+
+			System.out.println("");
+		}
+		rs.close();
+	}
+
+	private static String T8insert(PreparedStatement ps, int id, char[] base, int bl, char[] pattern, int pl, int pos, boolean addPattern)
+		throws SQLException {
+
+		StringBuffer sb = new StringBuffer();
+		sb.append(base, 0, bl);
+
+		// Assume the pattern looks like Abcdefgh
+		// put together a block of misleading matches such as
+		// AAbAbcAbcdAbcde
+
+		int last = addPatternPrefix(sb, pattern, pl, 5, 10);
+
+		if (last >= (pos / 2))
+			pos = (last + 10) * 2;
+
+		// now a set of misleading matches up to half the pattern width
+		last = addPatternPrefix(sb, pattern, pl, pl/2, pos/2);
+
+		if (last >= pos)
+			pos = last + 13;
+
+		// now a complete set of misleading matches
+		pos = addPatternPrefix(sb, pattern, pl, pl - 1, pos);
+
+		if (addPattern) {
+			// and then the pattern
+			sb.insert(pos, pattern, 0, pl);
+		} else {
+			pos = -1;
+		}
+
+
+		String dd = sb.toString();
+		String pstr = new String(pattern, 0, pl);
+
+		if (pos != dd.indexOf(pstr)) {
+			System.out.println("FAIL - test confused pattern not at expected location");
+
+			System.out.println("POS = " + pos + " index " + dd.indexOf(pstr));
+			System.out.println("LENG " + dd.length());
+			// System.out.println(sb.toString());
+		}
+
+
+		// JDBC uses 1 offset for first character
+		if (pos != -1)
+			pos = pos + 1;
+
+		ps.setInt(1, id);
+		ps.setString(2, dd);
+		ps.setInt(3, pos); 
+		ps.setInt(4, dd.length());
+		ps.executeUpdate();
+
+		return pstr;
+
+	}
+
+	private static int addPatternPrefix(StringBuffer sb, char[] pattern, int pl, int fakeCount, int pos) {
+
+		for (int i = 0; i < fakeCount && i < (pl - 1); i++) {
+
+			sb.insert(pos, pattern, 0, i + 1);
+			pos += i + 1;
+		}
+
+		return pos;
+	}
+
+    /* advanced tests */
+
+    // make sure clob is still around after we go to the next row,
+    // after we close the result set, and after we close the statement
+	private static void clobTest91(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			byte[] buff = new byte[128];
+            Clob[] clobArray = new Clob[numRows];
+            int[] clobLengthArray = new int[numRows];
+            int j = 0;
+			while (rs.next())
+            {
+                clobArray[j] = rs.getClob(1);
+                clobLengthArray[j++] = rs.getInt(2);
+            }
+            rs.close();
+            stmt.close();
+
+            for (int i = 0; i < numRows; i++)
+            {
+                if (clobArray[i] == null)
+                    {
+                        System.out.println("row " + i + " is null, skipped");
+                        continue;
+                    }
+				InputStream fin = clobArray[i].getAsciiStream();
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+                if (columnSize != clobLengthArray[i])
+					System.out.println("test failed, columnSize should be " +
+                        clobLengthArray[i] + ", but it is " + columnSize + ", i = " + i);
+                if (columnSize != clobArray[i].length())
+					System.out.println("test failed, clobArray[i].length() should be " +  columnSize
+					   + ", but it is " + clobArray[i].length() + ", i = " + i);
+                System.out.println("done row " + i + ", length was " + clobLengthArray[i]);
+            }
+            System.out.println("clobTest91 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test locking
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest92(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt,stmt2;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			// fetch row back, get the column as a clob.
+            Clob clob = null, shortClob = null;
+            int clobLength;
+			while (rs.next())
+            {
+                clobLength = rs.getInt(2);
+                if (clobLength == 10000)
+                    clob = rs.getClob(1);
+                if (clobLength == 26)
+                    shortClob = rs.getClob(1);
+			}
+            rs.close();
+
+            Connection conn2 = ij.startJBMS();
+            // turn off autocommit, otherwise blobs/clobs cannot hang around
+            // until end of transaction
+            conn2.setAutoCommit(false);
+
+            // update should go through since we don't get any locks on clobs
+            // that are not long columns
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testCLOB_MAIN set a = 'foo' where b = 26");
+            if (shortClob.length() != 26)
+                System.out.println("FAILED: clob length changed to " + shortClob.length());
+            // should timeout waiting for the lock to do this
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testCLOB_MAIN set b = b + 1 where b = 10000");
+
+            conn.commit();
+            conn2.rollback();
+            System.out.println("clobTest92 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test locking with a long row + long column
+    */
+	private static void clobTest93(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt, stmt2;
+        try
+        {
+			stmt = conn.createStatement();
+			// creating table to fit within default 4k table size, then add large columns
+			stmt.execute("create table testLongRowClob (a varchar(2000))");
+			stmt.execute("alter table testLongRowClob add column b varchar(3000)");
+			stmt.execute("alter table testLongRowClob add column c varchar(2000)");
+			stmt.execute("alter table testLongRowClob add column d varchar(3000)");
+			stmt.execute("alter table testLongRowClob add column e CLOB(400k)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testLongRowClob values(?,?,?,?,?)");
+            ps.setString(1,Formatters.padString("blaaa",2000));
+            ps.setString(2,Formatters.padString("tralaaaa",3000));
+            ps.setString(3,Formatters.padString("foodar",2000));
+            ps.setString(4,Formatters.padString("moped",3000));
+            File file = new File(fileName[1]);
+            if (file.length() < 10000)
+                System.out.println("ERROR: wrong file tested");
+            InputStream fileIn = new FileInputStream(file);
+            ps.setAsciiStream(5, fileIn, (int)file.length());
+            ps.executeUpdate();
+            fileIn.close();
+            conn.commit();
+
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select e from testLongRowClob");
+			// fetch row back, get the column as a clob.
+            Clob clob = null;
+			while (rs.next())
+                clob = rs.getClob(1);
+            rs.close();
+
+            Connection conn2 = ij.startJBMS();
+            // turn off autocommit, otherwise blobs/clobs cannot hang around
+            // until end of transaction
+            conn2.setAutoCommit(false);
+            // the following should timeout
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testLongRowClob set e = 'smurfball' where a = 'blaaa'");
+
+            conn.commit();
+            conn2.commit();
+            System.out.println("clobTest92 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    
+    /*
+        test accessing clob after commit
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest94(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			// fetch row back, get the column as a clob.
+            Clob clob = null, shortClob = null;
+            int clobLength;
+			while (rs.next())
+            {
+                clobLength = rs.getInt(2);
+                if (clobLength == 10000)
+                    clob = rs.getClob(1);
+                if (clobLength == 26)
+                    shortClob = rs.getClob(1);
+			}
+            rs.close();
+            conn.commit();
+
+            // no problem accessing this after commit since it is in memory
+            System.out.println("shortClob length after commit is " + shortClob.length());
+            // these should all give blob/clob data unavailable exceptions
+            try
+            {
+                clob.length();
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.getSubString(2,3);
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.getAsciiStream();
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.position("foo",2);
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.position(clob,2);
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+
+            System.out.println("clobTest94 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test accessing clob after closing the connection
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTest95(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			// fetch row back, get the column as a clob.
+            Clob clob = null, shortClob = null;
+            int clobLength;
+			while (rs.next())
+            {
+                clobLength = rs.getInt(2);
+                if (clobLength == 10000)
+                    clob = rs.getClob(1);
+                if (clobLength == 26)
+                    shortClob = rs.getClob(1);
+			}
+            rs.close();
+			conn.commit();
+            conn.close();
+
+			try {
+            // no problem accessing this after commit since it is in memory
+            System.out.println("shortClob length after closing connection is " + shortClob.length());
+			}
+			catch (SQLException e)
+			{
+				if (isDerbyNet)
+					System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+				else
+					TestUtil.dumpSQLExceptions(e);
+				
+			}
+            // these should all give blob/clob data unavailable exceptions
+            try
+            {
+                clob.length();
+            }
+            catch (SQLException e)
+            {
+				if (isDerbyNet)
+					System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+				else
+					TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.getSubString(2,3);
+            }
+            catch (SQLException e)
+            {
+				if (isDerbyNet)
+					System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+				else
+					TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.getAsciiStream();
+            }
+            catch (SQLException e)
+            {
+				if (isDerbyNet)
+					System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+				else
+					TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.position("foo",2);
+            }
+            catch (SQLException e)
+            {
+				if (isDerbyNet)
+					System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+				else
+					TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                clob.position(clob,2);
+            }
+            catch (SQLException e)
+            {
+				
+				if (isDerbyNet)
+					System.out.println("EXPECTED SQL Exception: " + e.getMessage());
+				else
+					TestUtil.dumpSQLExceptions(e);
+	    	}
+
+            System.out.println("clobTest95 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test clob finalizer closes the container
+        (should only release table and row locks that are read_committed)
+        need to run prepareCLOBMAIN first
+        NOTE: this test does not produce output since it needs to call the
+        garbage collector whose behaviour is unreliable. It is in the test run to
+        exercise the code (most of the time).
+    */
+	private static void clobTest96(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			byte[] buff = new byte[128];
+            Clob[] clobArray = new Clob[numRows];
+            int[] clobLengthArray = new int[numRows];
+            int j = 0;
+			while (rs.next())
+            {
+                clobArray[j] = rs.getClob(1);
+                clobLengthArray[j++] = rs.getInt(2);
+            }
+            rs.close();
+            stmt.close();
+
+            for (int i = 0; i < numRows; i++)
+            {
+                clobArray[i] = null;
+            }
+
+            System.gc();
+            System.gc();
+
+            // System.out.println("after gc");
+            // printLockTable(conn);
+
+            System.out.println("clobTest96 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    /*
+        test clob finalizer closes the container
+        (should only release table and row locks that are read_committed)
+        need to run prepareCLOBMAIN first
+        NOTE: this test does not produce output since it needs to call the
+        garbage collector whose behaviour is unreliable. It is in the test run to
+        exercise the code (most of the time).
+    */
+    /*
+     The bug here is that if we do 2 getBlobs on the same column, we reopen the
+     container twice, but only remember the 2nd container. Then closing the
+     container on one of the blobs causes the 2nd one not to work.
+     (Also, closing both blobs leaves one container open.) 
+    */
+
+	private static void bug2(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			byte[] buff = new byte[128];
+            Clob[] clobArray = new Clob[numRows*2];
+            int[] clobLengthArray = new int[numRows*2];
+            int j = 0;
+			while (rs.next())
+            {
+                clobArray[j] = rs.getClob(1);
+                clobLengthArray[j++] = rs.getInt(2);
+                clobArray[j] = rs.getClob(1);
+                clobLengthArray[j++] = rs.getInt(2);
+            }
+            rs.close();
+            stmt.close();
+
+            // null out clobs at all the even positions
+            for (int i = 0; i < numRows*2; i=i+2)
+            {
+                clobArray[i] = null;
+            }
+
+            System.gc();
+            System.gc();
+
+            System.out.println("after gc");
+            // printLockTable(conn);
+
+            // access clobs at all the odd positions
+            for (int i = 1; i < numRows*2+1; i=i+2)
+            {
+                if (clobArray[i].length() != clobLengthArray[i])
+                    System.out.println("Error at array position " + i);
+            }
+
+            System.out.println("clobTest97 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    /*
+        test locking
+        need to run prepareCLOBMAIN first
+    */
+	private static void clobTestGroupfetch(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt,stmt2;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN");
+			// fetch row back, get the column as a clob.
+            int clobLength;
+			while (rs.next())
+            {
+                clobLength = rs.getInt(2);
+                String s = rs.getString(1);
+                printLockTable(conn);
+			}
+            rs.close();
+
+            System.out.println("clobTestGroupFetch finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    This bug is happening because the clob.length() sets the stream to some
+    position (probably to the end). Then when you do a getString() on the same
+    column, you are using the same SQLChar object, and you try to call readExternal
+    on the stream, but since it isn't at the beginning it doesn't work.
+    */
+	private static void bug(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt, stmt2;
+        try
+        {
+			stmt = conn.createStatement();
+			// creating table to fit within default 4k table size, then add large columns
+			stmt.execute("create table testLongRowClob (a varchar(2000))");
+			stmt.execute("alter table testLongRowClob add column b varchar(3000)");
+			stmt.execute("alter table testLongRowClob add column c varchar(2000)");
+			stmt.execute("alter table testLongRowClob add column d varchar(3000)");
+			stmt.execute("alter table testLongRowClob add column e CLOB(400k)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testLongRowClob values(?,?,?,?,?)");
+            ps.setString(1,Formatters.padString("blaaa",2000));
+            ps.setString(2,Formatters.padString("tralaaaa",3000));
+            ps.setString(3,Formatters.padString("foodar",2000));
+            ps.setString(4,Formatters.padString("moped",3000));
+            File file = new File(fileName[1]);
+            if (file.length() < 10000)
+                System.out.println("ERROR: wrong file tested");
+            InputStream fileIn = new FileInputStream(file);
+            ps.setAsciiStream(5, fileIn, (int)file.length());
+            ps.executeUpdate();
+            fileIn.close();
+            conn.commit();
+
+            Connection conn2 = ij.startJBMS();
+            // turn off autocommit, otherwise blobs/clobs cannot hang around
+            // until end of transaction
+            conn2.setAutoCommit(false);
+
+            // printLockTable(conn2);
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select e from testLongRowClob");
+            printLockTable(conn2);
+
+			// fetch row back, get the column as a clob.
+            Clob clob = null;
+            int clobLength, i = 0;
+			while (rs.next())
+            {
+                i++;
+                clob = rs.getClob(1);
+                System.out.println("got it");
+                // bug doesn't happen if the below is commented out
+                System.out.println("clob length is " + clob.length());
+                System.out.println("the thing as a string is : \n" + rs.getString(1));
+                printLockTable(conn2);
+			}
+            rs.close();
+            System.out.println("After closing result set");
+            printLockTable(conn2);
+
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testLongRowClob set e = 'smurfball' where a = 'blaaa'");
+            printLockTable(conn2);
+
+            System.out.println("clob length is " + clob.length());
+
+            conn.commit();
+            conn2.commit();
+            System.out.println("clobTest92 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    // test getAsciiStream, print out the result
+    // this is just temporary, for comparison with getAsciiStream
+	private static void clobTest9999(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','4096')");
+			stmt.execute("create table clobTest9999 (a CLOB(300k))");
+			stmt.execute("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','0')");
+
+            int i = 4;
+            // prepare an InputStream from the file
+            File file = new File(fileName[i]);
+            fileLength[i] = file.length();
+            InputStream fileIn = new FileInputStream(file);
+
+            System.out.println("===> testing " + fileName[i] + " length = "
+								   + fileLength[i]);
+
+            // insert a streaming column
+            PreparedStatement ps = conn.prepareStatement("insert into clobTest9999 values(?)");
+            ps.setAsciiStream(1, fileIn, (int)fileLength[i]);
+            ps.executeUpdate();
+            fileIn.close();
+
+			rs = stmt.executeQuery("select a from clobTest9999");
+			met = rs.getMetaData();
+			// fetch row back, get the column as a clob.
+			while (rs.next()) {
+				// get the first column as a clob
+                Clob clob = rs.getClob(1);
+				InputStream fin = clob.getAsciiStream();
+				int columnSize = 0;
+				for (;;) {
+					int j = fin.read();
+					if (j == -1)
+						break;
+                    System.out.print((char) j);
+				}
+			}
+            System.out.println("Finished clobTest9999");
+
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    // test behaviour of system with self destructive user
+    // update a long column underneath a clob
+	private static void clobTestSelfDestructive(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN where b = 10000");
+			byte[] buff = new byte[128];
+			// fetch row back, get the column as a clob.
+            Clob clob = null;
+            InputStream fin;
+            int clobLength = 0, i = 0;
+			if (rs.next())
+            {
+                i++;
+                clobLength = rs.getInt(2);
+				// get the first column as a clob
+                clob = rs.getClob(1);
+            }
+            System.out.println("length of clob chosen is " + clobLength);
+            fin = clob.getAsciiStream();
+            int columnSize = 0;
+
+            PreparedStatement ps = conn.prepareStatement(
+                "update testCLOB_MAIN set a = ? where b = 10000");
+            StringBuffer foo = new StringBuffer();
+            for (int k = 0; k < 1000; k++)
+                foo.append('j');
+            ps.setString(1,foo.toString());
+            ps.executeUpdate();
+
+            System.out.println("After update");
+
+			rs = stmt.executeQuery("select a from testCLOB_MAIN where b = 10000");
+			while (rs.next())
+            {
+                int j = 1;
+                String val = rs.getString(1);
+                System.out.println("Row " + j + " value.substring(0,50) is " + val.substring(0,50));
+                j++;
+            }
+
+            while (columnSize < 11000)
+            {
+                int size = fin.read(buff);
+                if (size == -1)
+                    break;
+                columnSize += size;
+				// printing the return from each read is very implementation dependent
+            }
+            System.out.println(columnSize + " total bytes read");
+
+            if (columnSize != clobLength)
+                System.out.println("test failed, columnSize should be " + clobLength
+                    + ", but it is " + columnSize + ", i = " + i);
+            if (columnSize != clob.length())
+                System.out.println("test failed, clob.length() should be " +  columnSize
+                    + ", but it is " + clob.length() + ", i = " + i);
+            conn.rollback();
+            System.out.println("clobTestSelfDestructive finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    // test behaviour of system with self destructive user
+    // drop table and see what happens to the clob
+    // expect an IOException when moving to a new page of the long column
+	private static void clobTestSelfDestructive2(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testCLOB_MAIN where b = 10000");
+			byte[] buff = new byte[128];
+			// fetch row back, get the column as a clob.
+            Clob clob = null;
+            InputStream fin;
+            int clobLength = 0, i = 0;
+			if (rs.next())
+            {
+                i++;
+                clobLength = rs.getInt(2);
+				// get the first column as a clob
+                clob = rs.getClob(1);
+            }
+            System.out.println("length of clob chosen is " + clobLength);
+            fin = clob.getAsciiStream();
+            int columnSize = 0;
+
+			stmt.executeUpdate("drop table testCLOB_MAIN");
+            System.out.println("After drop");
+
+            System.out.println("Expect to get an IOException, container has been closed");
+            while (columnSize < 11000)
+            {
+                int size = fin.read(buff);
+                if (size == -1)
+                    break;
+                columnSize += size;
+				// printing the return from each read is very implementation dependent
+            }
+            System.out.println(columnSize + " total bytes read");
+
+            conn.rollback();
+            System.out.println("clobTestSelfDestructive2 finished");
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (java.io.IOException ioe)
+		{
+			System.out.println("EXPECTED IO Exception:" + ioe.getMessage());
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+	private static void printLockTable(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt,stmt2;
+        try
+        {
+            System.out.println("\nLock table\n----------------------------------------");
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery(
+                "select xid,type,lockcount,mode,tablename,lockname,state from new LockTable() t where t.tableType <> 'S'");
+            while (rs.next())
+            {
+                String xid = rs.getString("xid");
+                String type = rs.getString("type");
+                String lockcount = rs.getString("lockcount");
+                String mode = rs.getString("mode");
+                String tablename = rs.getString("tablename");
+                String lockname = rs.getString("lockname");
+                String state = rs.getString("state");
+                System.out.println("Lock{xid = " + xid + ", type = " + type +
+                    ", lockcount = " + lockcount + ", mode = " + mode +
+                    ", tablename = " + tablename + ", lockname = " + lockname +
+                    ", state = " + state + " } ");
+            }
+            System.out.println("----------------------------------------\n");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+
+
+
+    private static void unicodeTest()
+    {
+        try
+        {
+            // String to Unicode bytes
+            byte[] unicodeArray = {0xfffffffe, 0xffffffff, 0x01, 0x68, 0x00, 0x65,
+                            0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6f};
+            String str = new String (unicodeArray, "Unicode");
+            System.out.println("First string is : " + str);
+            // byte[] array = str.getBytes("UnicodeBigUnmarked");
+            // Unicode bytes to String
+            // double byte not supported
+            // str = new String (array, "DoubleByte");
+            // System.out.println("Second string is : " + str);
+
+            byte[] uni2 = {0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65};
+            String suni2 = new String (uni2,"Unicode");
+            System.out.println("uni2 is :" + uni2);
+
+            String uni3 = "\u0020\u0021\u0023";
+            System.out.println("uni3 is :" + uni3);
+            String uni4 = "\u0061\u0062\u0063";
+            System.out.println("uni4 is :" + uni4);
+            System.out.println("uni4 equals abc ? " + uni4.equals("abc"));
+            String uni5 = "\u0370\u0371\u0372";
+            System.out.println("uni5 is :" + uni5);
+            System.out.println("uni5 equals ??? ? " + uni5.equals("???"));
+            System.out.println("uni5 equals uni5 ? " + uni5.equals(uni5));
+            String uni6 = "\u05d0\u05d1\u05d2";
+            System.out.println("uni6 is :" + uni6);
+            System.out.println("uni5 equals uni6 ? " + uni5.equals(uni6));
+            System.out.println("uni6 equals uni6 ? " + uni6.equals(uni6));
+
+            FileWriter fw;
+
+        }
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+            if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        Set up a table with all kinds of blob values,
+        some short (less than 1 page), some long (more than 1 page)
+        some very large (many pages).
+        Table has 2 cols: the first is the value, the second is the length of
+        the value.
+        (Also sets the fileLength array.)
+    */
+    private static void prepareBlobTable(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			// creating table to fit within default 4k table size, then add large column
+			stmt.execute("create table testBlob (b integer)");
+			stmt.execute("alter table testBlob add column a blob(300k)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testBlob (a, b) values(?,?)");
+
+            // insert small strings
+			insertRow(ps,"".getBytes());
+            insertRow(ps,"you can lead a horse to water but you can't form it into beverage".getBytes());
+            insertRow(ps,"a stitch in time says ouch".getBytes());
+            insertRow(ps,"here is a string with a return \n character".getBytes());
+
+            // insert larger strings using setAsciiStream
+            for (int i = 0; i < numFiles; i++)
+            {
+                // prepare an InputStream from the file
+                File file = new File(fileName[i]);
+                fileLength[i] = file.length();
+                InputStream fileIn = new FileInputStream(file);
+
+                System.out.println("===> inserting " + fileName[i] + " length = "
+				    				   + fileLength[i]);
+
+                // insert a streaming column
+                ps.setBinaryStream(1, fileIn, (int)fileLength[i]);
+                ps.setInt(2, (int)fileLength[i]);
+                ps.executeUpdate();
+                fileIn.close();
+            }
+
+            // insert a null
+            ps.setNull(1, Types.BLOB);
+            ps.setInt(2, 0);
+            ps.executeUpdate();
+
+            conn.commit();
+
+            // set numRows
+			rs = stmt.executeQuery("select count(*) from testBlob");
+            int realNumRows = -1;
+			if (rs.next())
+                realNumRows = rs.getInt(1);
+            if (realNumRows <= 0)
+                System.out.println("FAIL. No rows in table testCLOB_MAIN");
+            if (realNumRows != numRows)
+                System.out.println("FAIL. numRows is incorrect");
+
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        Set up a table with binary values,
+        Table has 2 cols: the first is the value, the second is the length of
+        the value.
+    */
+    private static void prepareBinaryTable(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try
+        {
+			stmt = conn.createStatement();
+			stmt.execute("create table testBinary (a blob(80), b integer)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testBinary values(?,?)");
+
+            // insert small strings
+			insertRow(ps,"".getBytes());
+            insertRow(ps,"you can lead a horse to water but you can't form it into beverage".getBytes());
+            insertRow(ps,"a stitch in time says ouch".getBytes());
+            insertRow(ps,"here is a string with a return \n character".getBytes());
+
+            // insert a null
+            // ps.setNull(1, Types.BINARY);
+            // ps.setInt(2, 0);
+            // ps.executeUpdate();
+
+            conn.commit();
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e)
+        {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+
+    /*
+        Set up a table with blobs to search for
+        most short (less than 1 page), some long (more than 1 page)
+        some very large (many pages) ??
+    */
+    private static void prepareSearchBlobTable(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			// creating table to fit within default 4k table size, then add large column
+			stmt.execute("create table searchBlob (b integer)");
+			stmt.execute("alter table searchBlob add column a blob(300k)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into searchBlob (a, b) values(?,?)");
+            insertRow(ps,"horse".getBytes());
+            insertRow(ps,"ouch".getBytes());
+            insertRow(ps,"\n".getBytes());
+            insertRow(ps,"".getBytes());
+            insertRow(ps,"Beginning".getBytes());
+            insertRow(ps,"position-69".getBytes());
+            insertRow(ps,"I-am-hiding-here-at-position-5910".getBytes());
+            insertRow(ps,"Position-9907".getBytes());
+
+            // insert larger blobs using setBinaryStream
+            for (int i = 0; i < numFiles; i++)
+            {
+                // prepare an InputStream from the file
+                File file = new File(fileName[i]);
+                fileLength[i] = file.length();
+                InputStream fileIn = new FileInputStream(file);
+
+                System.out.println("===> inserting " + fileName[i] + " length = "
+				    				   + fileLength[i]);
+
+                // insert a streaming column
+                ps.setBinaryStream(1, fileIn, (int)fileLength[i]);
+                ps.setInt(2, (int)fileLength[i]);
+                ps.executeUpdate();
+                fileIn.close();
+            }
+
+            // insert a null
+            ps.setNull(1, Types.BLOB);
+            ps.setInt(2, 0);
+            ps.executeUpdate();
+
+            conn.commit();
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        basic test of getBinaryStream
+        also tests length
+        need to run prepareBlobTable first
+    */
+	private static void blobTest0(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+			byte[] buff = new byte[128];
+			// fetch row back, get the long varbinary column as a blob.
+            Blob blob;
+            int blobLength = 0, i = 0;
+			while (rs.next()) {
+                i++;
+				// get the first column as a clob
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+				InputStream fin = blob.getBinaryStream();
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+                blobLength = rs.getInt(2);
+                if (columnSize != blobLength)
+					System.out.println("test failed, columnSize should be " + blobLength
+					   + ", but it is " + columnSize + ", i = " + i);
+                if (columnSize != blob.length())
+					System.out.println("test failed, blob.length() should be " +  columnSize
+					   + ", but it is " + blob.length() + ", i = " + i);
+			}
+            conn.commit();
+            System.out.println("blobTest0 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test getBytes
+    need to run prepareBlobTable first
+    */
+	private static void blobTest2(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+            int i = 0, blobLength = 0;
+            Blob blob;
+			while (rs.next())
+            {
+                i++;
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+                blobLength = rs.getInt(2);
+                blobclob4BLOB.printInterval(blob, 9905, 50, 0, i, blobLength);
+                blobclob4BLOB.printInterval(blob, 5910, 150, 1, i, blobLength);
+                blobclob4BLOB.printInterval(blob, 5910, 50, 2, i, blobLength);
+                blobclob4BLOB.printInterval(blob, 204, 50, 3, i, blobLength);
+                blobclob4BLOB.printInterval(blob, 68, 50, 4, i, blobLength);
+                blobclob4BLOB.printInterval(blob, 1, 50, 5, i, blobLength);
+                blobclob4BLOB.printInterval(blob, 1, 1, 6, i, blobLength);
+                /*
+                System.out.println(i + "(0) " + new String(blob.getBytes(9905,50)));
+                System.out.println(i + "(1) " + new String(blob.getBytes(5910,150)));
+                System.out.println(i + "(2) " + new String(blob.getBytes(5910,50)));
+                System.out.println(i + "(3) " + new String(blob.getBytes(204,50)));
+                System.out.println(i + "(4) " + new String(blob.getBytes(68,50)));
+                System.out.println(i + "(5) " + new String(blob.getBytes(1,50)));
+                System.out.println(i + "(6) " + new String(blob.getBytes(1,1)));
+                */
+                if (blobLength > 100)
+                {
+                    byte[] res = blob.getBytes(blobLength-99,200);
+                    System.out.println(i + "(7) ");
+                    if (res.length != 100)
+                        System.out.println("FAIL : length of bytes is " +
+                            res.length + " should be 100");
+                    else
+                        System.out.println(new String(res));
+                }
+            }
+            System.out.println("blobTest2 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test position with a byte[] argument
+    need to run prepareBlobTable first
+    */
+	private static void blobTest3(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+            int i = 0, blobLength = 0;
+            Blob blob;
+			while (rs.next())
+            {
+                i++;
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+               blobLength = rs.getInt(2);
+                if (blobLength > 20000)
+                    continue;
+                blobLength = rs.getInt(2);
+                blobclob4BLOB.printPosition(i,"horse",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"ouch",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"\n",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"Beginning",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"Beginning",2,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"position-69",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"This-is-position-204",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"I-am-hiding-here-at-position-5910",1,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"I-am-hiding-here-at-position-5910",5910,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"I-am-hiding-here-at-position-5910",5911,blob, blobLength);
+                blobclob4BLOB.printPosition(i,"Position-9907",1,blob, blobLength);
+            }
+            System.out.println("blobTest3 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    /*
+    test position with a Blob argument
+    need to run prepareBlobTable and prepareSearchBlobTable first
+    */
+	private static void blobTest4(Connection conn)
+    {
+		ResultSet rs, rs2;
+		Statement stmt, stmt2;
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+            int i = 0, blobLength = 0;
+            Blob blob;
+			while (rs.next())
+            {
+                i++;
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+                blobLength = rs.getInt(2);
+                if (blobLength > 20000)
+                    {
+                        System.out.println("testBlob row " + i + " skipped (too large)");
+                        continue;
+                    }
+                // inner loop over table of blobs to search for
+                // blobs
+			    stmt2 = conn.createStatement();
+			    rs2 = stmt2.executeQuery("select a,b from searchBlob");
+                int j = 0, blobLength2 = 0;
+                Blob searchBlob;
+                String searchStr;
+			    while (rs2.next())
+                {
+                    j++;
+                    searchBlob = rs2.getBlob(1);
+                    if (searchBlob == null)
+                        continue;
+                    blobLength2 = rs2.getInt(2);
+                    if (blobLength2 > 20000)
+                    {
+                        System.out.println("searchBlob row " + j + " skipped (too large)");
+                        continue;
+                    }
+                    if (blobLength2 < 150)
+                        searchStr = new String(rs2.getBytes(1));
+                    else
+                        searchStr = null;
+
+                    printPositionBlob(i,searchStr,1,blob,j,searchBlob);
+                }
+            }
+            System.out.println("blobTest4 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    private static void printPositionBlob(
+        int rowNum,
+        String searchStr,
+        long position,
+        Blob blob,
+        int searchRowNum,
+        Blob searchBlob)
+    {
+        try
+        {
+            long result = blob.position(searchBlob,position);
+            if ((searchStr != null) && searchStr.equals("") && (result == 1))
+                return;
+            if (result != -1)
+            {
+                System.out.print("Found ");
+                if (searchStr != null)
+                    System.out.print(searchStr);
+                else
+                    System.out.print("blob (row " + searchRowNum + ") ");
+                System.out.println(" in row " + rowNum + " at position " + result);
+            }
+        }
+		catch (SQLException e)
+        {
+			TestUtil.dumpSQLExceptions(e);
+		}
+    }
+
+    /* datatype tests */
+
+    // make sure blobs work for regular varbinary fields
+    // also test length method
+	private static void blobTest51(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testVarbinary (a blob(13))");
+
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testVarbinary values(?)");
+			String val = "";
+			
+            for (int i = 0; i < 10; i++)
+            {
+                // insert a string
+                ps.setBytes(1, val.getBytes());
+                ps.executeUpdate();
+                val = val.trim() + "x";
+            }
+
+			rs = stmt.executeQuery("select a from testVarbinary");
+			met = rs.getMetaData();
+			byte[] buff = new byte[128];
+            int j = 0;
+			// fetch all rows back, get the columns as clobs.
+			while (rs.next())
+            {
+				// get the first column as a clob
+                Blob blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+				InputStream fin = blob.getBinaryStream();
+				int columnSize = 0;
+				for (;;)
+                {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+                if (columnSize != j)
+                    System.out.println("FAIL - Expected blob size : " + j +
+                        " Got blob size : " + columnSize);
+                if (blob.length() != j)
+                    System.out.println("FAIL - Expected blob length : " + j +
+                        " Got blob length : " + blob.length());
+                j++;
+			}
+            System.out.println("blobTest51 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+   // make sure cannot get a blob from an int column
+	private static void blobTest52(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testInteger2 (a integer)");
+
+            int i = 1;
+            PreparedStatement ps = conn.prepareStatement("insert into testInteger2 values(158)");
+            ps.executeUpdate();
+
+			rs = stmt.executeQuery("select a from testInteger2");
+			met = rs.getMetaData();
+			while (rs.next()) {
+				// get the first column as a clob
+                Blob blob = rs.getBlob(1);
+			}
+            System.out.println("blobTest52 finished");
+        }
+		catch (SQLException e) {
+			expectedExceptionForNSOnly(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+   // test creating a blob column, currently this doesn't work since we don't
+   // have a blob datatype (get a syntax error on the create table statement)
+	private static void blobTest53(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testBlobColumn (a blob(1K))");
+
+            System.out.println("blobTest53 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    /*
+        make sure setBlob doesn't work for an int column
+        need to run prepareBlobTable first
+    */
+	private static void blobTest54(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt1, stmt2;
+        try
+        {
+			stmt1 = conn.createStatement();
+			stmt1.execute("create table testBlob2 (a integer, b integer)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testBlob2 values(?,?)");
+			stmt2 = conn.createStatement();
+			rs = stmt2.executeQuery("select a,b from testBlob");
+            Blob blob;
+            int blobLength;
+			while (rs.next())
+            {
+				// get the first column as a blob
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+                blobLength = rs.getInt(2);
+                ps.setBlob(1,blob);
+                ps.setInt(2,blobLength);
+                ps.executeUpdate();
+			}
+            rs.close();
+            conn.commit();
+
+            System.out.println("blobTest54 finished");
+        }
+		catch (SQLException e) {
+		    expectedExceptionForNSOnly(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+    test raising of exceptions
+    need to run prepareBlobTable first
+    */
+	private static void blobTest6(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+            int i = 0, blobLength = 0;
+            Blob blob;
+			while (rs.next())
+            {
+                if (i > 0)
+                    break;
+                i++;
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+                blobLength = rs.getInt(2);
+                // test end cases
+
+                // 0 or negative position value
+                try
+                {
+                    blob.getBytes(0,5);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+		        }
+                // negative length value
+                try
+                {
+                    blob.getBytes(1,-76);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+		        }
+                // zero length value
+                try
+                {
+                    blob.getBytes(1,0);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+		        }
+                // 0 or negative position value
+                try
+                {
+                    blob.position(new byte[0],-4000);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+		        }
+                // null pattern
+                try
+                {
+					// bug 5247 in network server (NPE)
+                    blob.position((byte[]) null,5);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isNullSearchPattern(e));
+		        }
+                // 0 or negative position value
+                try
+                {
+                    blob.position(blob,-42);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isOutOfBoundException(e));
+		        }
+                // null pattern
+                try
+                {
+                    blob.position((Blob) null,5);
+                }
+        		catch (SQLException e)
+                {
+			        TestUtil.dumpSQLExceptions(e,isNullSearchPattern(e));
+		        }
+            }
+            System.out.println("blobTest6 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			if (e instanceof NullPointerException)
+			{
+				if (isDerbyNet)
+					System.out.println("NullPointerException: KNOWN JCC issue Bug 5247");
+			}
+			else 
+			{
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+			}
+		}
+    }
+
+    /*
+        test setBlob
+        need to run prepareBlobTable first
+    */
+	private static void blobTest7(Connection conn)
+    {
+		ResultSet rs, rs2;
+		Statement stmt1, stmt2;
+        try
+        {
+			stmt1 = conn.createStatement();
+			stmt1.execute("create table testBlobX (a blob(300K), b integer)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testBlobX values(?,?)");
+			stmt2 = conn.createStatement();
+			rs = stmt2.executeQuery("select a,b from testBlob");
+            Blob blob;
+            int blobLength;
+			while (rs.next())
+            {
+				// get the first column as a blob
+                blob = rs.getBlob(1);
+                if (blob == null)
+                    continue;
+                blobLength = rs.getInt(2);
+                ps.setBlob(1,blob);
+                ps.setInt(2,blobLength);
+                ps.executeUpdate();
+			}
+            rs.close();
+            conn.commit();
+
+			rs2 = stmt2.executeQuery("select a,b from testBlobX");
+            Blob blob2;
+            int blobLength2, j = 0;
+			while (rs2.next())
+            {
+                j++;
+				// get the first column as a clob
+                blob2 = rs2.getBlob(1);
+                if (blob2 == null)
+                    continue;
+                blobLength2 = rs2.getInt(2);
+                if (blob2.length() != blobLength2)
+                    System.out.println("FAILED at row " + j);
+			}
+            rs2.close();
+
+            conn.commit();
+            System.out.println("blobTest7 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("blobTest7 FAIL -- unexpected exception:" + e.toString());
+            e.fillInStackTrace();
+            if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /* advanced tests */
+
+    // make sure blob is still around after we go to the next row,
+    // after we close the result set, and after we close the statement
+	private static void blobTest91(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+			byte[] buff = new byte[128];
+            Blob[] blobArray = new Blob[numRows];
+            int[] blobLengthArray = new int[numRows];
+            int j = 0;
+			while (rs.next())
+            {
+                blobArray[j] = rs.getBlob(1);
+                blobLengthArray[j++] = rs.getInt(2);
+            }
+            rs.close();
+            stmt.close();
+
+            for (int i = 0; i < numRows; i++)
+            {
+                if (blobArray[i] == null)
+                    {
+                        System.out.println("row " + i + " is null, skipped");
+                        continue;
+                    }
+				InputStream fin = blobArray[i].getBinaryStream();
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+                if (columnSize != blobLengthArray[i])
+					System.out.println("test failed, columnSize should be " +
+                        blobLengthArray[i] + ", but it is " + columnSize + ", i = " + i);
+                if (columnSize != blobArray[i].length())
+					System.out.println("test failed, blobArray[i].length() should be " +  columnSize
+					   + ", but it is " + blobArray[i].length() + ", i = " + i);
+                System.out.println("done row " + i + ", length was " + blobLengthArray[i]);
+            }
+            System.out.println("blobTest91 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test locking
+        need to run prepareBlobTable first
+    */
+	private static void blobTest92(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt,stmt2;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+			// fetch row back, get the column as a blob.
+            Blob blob = null, shortBlob = null;
+            int blobLength;
+			while (rs.next())
+            {
+                blobLength = rs.getInt(2);
+                if (blobLength == 10000)
+                    blob = rs.getBlob(1);
+                if (blobLength == 26)
+                    shortBlob = rs.getBlob(1);
+			}
+            rs.close();
+
+            Connection conn2 = ij.startJBMS();
+            // turn off autocommit, otherwise blobs/clobs cannot hang around
+            // until end of transaction
+            conn2.setAutoCommit(false);
+            // update should go through since we don't get any locks on blobs
+            // that are not long columns
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testBlob set a = null where b = 26");
+            if (shortBlob.length() != 26)
+                System.out.println("FAILED: blob length changed to " + shortBlob.length());
+            // should timeout waiting for the lock to do this
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testBlob set b = b + 1 where b = 10000");
+
+            conn.commit();
+            conn2.commit();
+            System.out.println("blobTest92 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test locking with a long row + long column
+    */
+	private static void blobTest93(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt, stmt2;
+        try
+        {
+			stmt = conn.createStatement();
+			// creating table to fit within default 4k table size, then add large columns
+			stmt.execute("create table testLongRowBlob (a varchar(2000))");
+			stmt.execute("alter table testLongRowBlob add column b varchar(3000)");
+			stmt.execute("alter table testLongRowBlob add column c varchar(2000)");
+			stmt.execute("alter table testLongRowBlob add column d varchar(3000)");
+			stmt.execute("alter table testLongRowBlob add column e blob(300k)");
+            PreparedStatement ps = conn.prepareStatement(
+                "insert into testLongRowBlob values(?,?,?,?,?)");
+            ps.setString(1,Formatters.padString("blaaa",2000));
+            ps.setString(2,Formatters.padString("tralaaaa",3000));
+            ps.setString(3,Formatters.padString("foodar",2000));
+            ps.setString(4,Formatters.padString("moped",3000));
+            File file = new File(fileName[1]);
+            if (file.length() < 10000)
+                System.out.println("ERROR: wrong file tested");
+            InputStream fileIn = new FileInputStream(file);
+            ps.setBinaryStream(5, fileIn, (int)file.length());
+            ps.executeUpdate();
+            fileIn.close();
+            conn.commit();
+
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select e from testLongRowBlob");
+            Blob blob = null;
+			while (rs.next())
+                blob = rs.getBlob(1);
+            rs.close();
+
+            Connection conn2 = ij.startJBMS();
+            // turn off autocommit, otherwise blobs/clobs cannot hang around
+            // until end of transaction
+            conn2.setAutoCommit(false);
+            // the following should timeout
+            stmt2 = conn2.createStatement();
+            stmt2.executeUpdate("update testLongRowBlob set e = null where a = 'blaaa'");
+
+            conn.commit();
+            conn2.commit();
+            System.out.println("blobTest93 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test accessing blob after commit
+        need to run prepareCLOBMAIN first
+    */
+	private static void blobTest94(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+			// fetch row back, get the column as a blob.
+            Blob blob = null, shortBlob = null;
+            int blobLength;
+			while (rs.next())
+            {
+                blobLength = rs.getInt(2);
+                if (blobLength == 10000)
+                    blob = rs.getBlob(1);
+                if (blobLength == 26)
+                    shortBlob = rs.getBlob(1);
+			}
+            rs.close();
+            conn.commit();
+
+            // no problem accessing this after commit since it is in memory
+            System.out.println("shortBlob length after commit is " + shortBlob.length());
+            // these should all give blob/clob data unavailable exceptions
+
+            try
+            {
+                blob.length();
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                blob.getBytes(2,3);
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                blob.getBinaryStream();
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                blob.position("foo".getBytes(),2);
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+            try
+            {
+                blob.position(blob,2);
+            }
+            catch (SQLException e)
+            {
+    			TestUtil.dumpSQLExceptions(e);
+	    	}
+
+            System.out.println("blobTest94 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+
+    }
+
+    /*
+        test accessing blob after closing the connection
+        need to run prepareCLOBMAIN first
+    */
+	private static void blobTest95(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+        try
+        {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+			// fetch row back, get the column as a blob.
+            Blob blob = null, shortBlob = null;
+            int blobLength;
+			while (rs.next())
+            {
+                blobLength = rs.getInt(2);
+                if (blobLength == 10000)
+                    blob = rs.getBlob(1);
+                if (blobLength == 26)
+                    shortBlob = rs.getBlob(1);
+			}
+            rs.close();
+			conn.rollback();
+            conn.close();
+
+			try {
+				// no problem accessing this after commit since it is in memory
+				System.out.println("shortBlob length after closing the connection is " + shortBlob.length());
+			}
+			catch (SQLException e)
+			{
+				expectedExceptionForNSOnly (e);
+			}
+
+				// these should all give blob/clob data unavailable exceptions
+            try
+            {
+                blob.length();
+            }
+            catch (SQLException e)
+            {
+				expectedExceptionForNSOnly (e);
+	    	}
+            try
+            {
+                blob.getBytes(2,3);
+            }
+            catch (SQLException e)
+            {
+				expectedExceptionForNSOnly (e);
+	    	}
+            try
+            {
+                blob.getBinaryStream();
+            }
+            catch (SQLException e)
+            {
+				expectedExceptionForNSOnly (e);
+	    	}
+            try
+            {
+                blob.position("foo".getBytes(),2);
+            }
+            catch (SQLException e)
+            {
+				expectedExceptionForNSOnly (e);
+	    	}
+            try
+            {
+                blob.position(blob,2);
+            }
+            catch (SQLException e)
+            {
+				expectedExceptionForNSOnly (e);
+	    	}
+
+            // restart the connection
+            conn = ij.startJBMS();
+            conn.setAutoCommit(false);
+
+            System.out.println("blobTest95 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+
+    /*
+        test blob finalizer closes the container
+        (should only release table and row locks that are read_committed)
+        need to run prepareCLOBMAIN first
+        NOTE: this test does not produce output since it needs to call the
+        garbage collector whose behaviour is unreliable. It is in the test run to
+        exercise the code (most of the time).
+    */
+	private static void blobTest96(Connection conn)
+    {
+		ResultSet rs;
+		Statement stmt;
+		try {
+			stmt = conn.createStatement();
+			rs = stmt.executeQuery("select a,b from testBlob");
+			byte[] buff = new byte[128];
+            Blob[] blobArray = new Blob[numRows];
+            int[] blobLengthArray = new int[numRows];
+            int j = 0;
+			while (rs.next())
+            {
+                blobArray[j] = rs.getBlob(1);
+                blobLengthArray[j++] = rs.getInt(2);
+            }
+            rs.close();
+            stmt.close();
+
+            // printLockTable(conn);
+
+            for (int i = 0; i < numRows; i++)
+            {
+                blobArray[i] = null;
+            }
+
+            // printLockTable(conn);
+
+            System.gc();
+            System.gc();
+
+            // System.out.println("after gc");
+            // printLockTable(conn);
+
+            System.out.println("blobTest96 finished");
+        }
+		catch (SQLException e) {
+			TestUtil.dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			if (debug) e.printStackTrace();
+		}
+    }
+
+    static void printInterval(Clob clob, long pos, int length,
+        int testNum, int iteration, int clobLength)
+    {
+		if (pos > clobLength)
+			System.out.println("CLOB getSubString " + pos + " > " + clobLength);
+        try
+        {
+			/*
+			System.out.println("printInterval(" + clob + "," + pos +"," +
+						   length +"," + testNum + "," + iteration + "," +
+						   clobLength + ")");
+			*/
+			String ss = clob.getSubString(pos,length);
+
+            System.out.println(iteration + "(" + testNum + ") (len " + length + ") " + ss);
+			if (ss.length() > length)
+				System.out.println("FAIL getSubString("+pos+","+length+") returned a string of length " + ss.length());
+
+			long l1 = clob.length();
+			if (l1 != clobLength) {
+				System.out.println("CHECK - test has mismatched lengths " + l1 + " != " + clobLength);
+			}
+			if (pos > clobLength)
+				System.out.println("CLOB FAIL - NO ERROR ON getSubString POS TOO LARGE " + pos + " > " + clobLength);
+
+
+        }
+		catch (SQLException e)
+        {
+			String state = e.getSQLState();
+			boolean expected = false;
+
+
+			if (pos < 1 || pos > clobLength)
+				expected = isOutOfBoundException(e);
+			TestUtil.dumpSQLExceptions(e, expected);
+			if (!expected) e.printStackTrace();
+		}
+		catch (Exception e)
+		{
+			if ((pos > clobLength) && isDerbyNet && (e.getMessage() != null &&
+													e.getMessage().indexOf("String index out of range") >= 0))
+				System.out.println("Known JCC Bug 5914 - " + e.getMessage());
+			else System.out.println("Known JCC Bug 5914");
+		}
+    }
+
+    static void printInterval(Blob blob, long pos, int length,
+        int testNum, int iteration, long blobLength)
+    {
+		if (pos > blobLength)
+			System.out.println("testing Blob.getBytes() with pos " + pos + " > " + blobLength);
+        try
+        {
+            System.out.println(iteration + "(" + testNum + ") " +
+                new String(blob.getBytes(pos,length)));
+
+			long l1 = blob.length();
+			if (l1 != blobLength) {
+				System.out.println("CHECK - test has mismatched lengths " + l1 + " != " + blobLength);
+			}
+			if (pos > blobLength)
+				System.out.println("FAIL testing Blob.getBytes() with pos " + pos + " > " + blobLength);
+        }
+		catch (SQLException e)
+        {
+			String state = e.getSQLState();
+			boolean expected = false;
+
+			if (pos < 1 || pos > blobLength)
+				expected = isOutOfBoundException(e);
+
+			TestUtil.dumpSQLExceptions(e, expected);
+		}
+		catch (Exception e)
+		{
+			if ((pos > blobLength) && isDerbyNet)
+				System.out.println("Known JCC Bug 5914");
+		}
+    }
+    static void printPosition(
+        int rowNum,
+        String searchStr,
+        long position,
+        Clob clob,
+		long clobLength)
+    {
+
+        try
+        {
+
+            long result = clob.position(searchStr,position);
+
+            System.out.println("Found " + searchStr + " in row " + rowNum +
+                    " starting from position " + position + " at position " +
+                    (result == -1 ? " NOTFOUND " : Long.toString(result)));
+
+			long l1 = clob.length();
+			if (l1 != clobLength) {
+				System.out.println("CHECK - test has mismatched lengths " + l1 + " != " + clobLength);
+			}
+
+
+        }
+		catch (SQLException e)
+        {
+			String state = e.getSQLState();
+			boolean expected = false;
+
+			if (position < 1 || position > clobLength)
+				expected = isOutOfBoundException(e);
+
+			if (searchStr == null)
+				if ("XJ072".equals(state))
+					expected = true;
+
+			if ("".equals(searchStr))
+				if ("XJ078".equals(state))
+					expected = true;
+	
+				
+			TestUtil.dumpSQLExceptions(e, expected);
+			e.printStackTrace();
+		}
+    }
+
+    static void printPosition(
+        int rowNum,
+        String searchStr,
+        long position,
+        Blob blob, int blobLength)
+    {
+        try
+        {
+            long result = blob.position(searchStr.getBytes(),position);
+            if ((searchStr == "") && (result == 1))
+                return;
+            if (result != -1)
+                System.out.println("Found " + searchStr + " in row " + rowNum +
+                    " starting from position " + position + " at position " +
+                    result);
+
+			long l1 = blob.length();
+			if (l1 != blobLength) {
+				System.out.println("CHECK - test has mismatched lengths " + l1 + " != " + blobLength);
+			}
+        }
+		catch (SQLException e)
+        {
+			String state = e.getSQLState();
+			boolean expected = false;
+
+			if (position < 1 || position > blobLength)
+				expected = isOutOfBoundException(e);
+
+			if (searchStr == null)
+				if ("XJ072".equals(state))
+					expected = true;
+
+			if ("".equals(searchStr))
+				if ("XJ078".equals(state))
+					expected = true;
+	
+				
+			TestUtil.dumpSQLExceptions(e, expected);
+		}
+    }
+	/**
+	 * In network server we expect an exception.
+	 * In embedded we don't
+	 */
+	 
+	static private void expectedExceptionForNSOnly (SQLException se)
+	{
+		TestUtil.dumpSQLExceptions(se, isDerbyNet);
+	}
+
+	static private boolean isOutOfBoundException(SQLException se)
+	{
+		String sqlState = se.getSQLState();
+		String msg = se.getMessage();
+		if ("XJ070".equals(sqlState) ||
+			"XJ071".equals(sqlState) ||
+			"XJ076".equals(sqlState) ||
+			(sqlState  == null && 
+			 ((msg.indexOf("Index Out Of Bound") != -1) ||
+			  (msg.indexOf("Invalid position") != -1))))
+			return true;
+			
+		return false;
+	}
+
+	static private boolean isNullSearchPattern(SQLException se)
+	{
+		String sqlState = se.getSQLState();
+		if ("XJ072".equals(sqlState) ||
+			(sqlState  == null &&
+			 se.getMessage().indexOf("Search pattern cannot be null") != -1))
+			return true;
+			
+		return false;
+	}
+}
+
+
+
+
+
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,7 @@
+# excluding with jdk13 and ibm13 due to a jvm bug reported in beetle 5788
+runwithjdk13=false
+runwithibm13=false
+# runwithj9=false
+supportfiles=tests/jdbcapi/short.txt,tests/jdbcapi/littleclob.txt,tests/jdbcapi/empty.txt,tests/jdbcapi/aclob.txt,tests/jdbcapi/searchclob.txt
+usedefaults=true
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+derby.locks.deadlockTimeout=3
+derby.locks.waitTimeout=4
+derby.storage.rowLocking=true
+# derby.storage.userLockTrace=true

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml	Tue Jan 11 11:53:57 2005
@@ -42,7 +42,7 @@
 
 <!--             ============ Begin Targets ==============                -->
  
-  <target name="FTOtestsubdir" depends="compilet2,compilet1,copyfiles"/>
+  <target name="FTOtestsubdir" depends="compilex,compilet2,compilet1,copyfiles"/>
 
   <!-- mkdir / init target may not be necessary, just here for reference... -->
   <target name="init">
@@ -66,9 +66,16 @@
         <pathelement path="${compile.classpath}"/>
       </classpath>
       <include name="${this.dir}/*.java"/>
-      <exclude name="${this.dir}/savepointJdbc30.java"/>
+      <exclude name="${this.dir}/autoGeneratedJdbc30.java"/>
+      <exclude name="${this.dir}/dbMetaDataJdbc30.java"/>
+      <exclude name="${this.dir}/checkDataSource.java"/>
+      <exclude name="${this.dir}/checkDataSource30.java"/>
       <exclude name="${this.dir}/dataSourcePermissions.java"/>
       <exclude name="${this.dir}/parameterMetaDataJdbc30.java"/>
+      <exclude name="${this.dir}/resultsetJdbc30.java"/>
+      <exclude name="${this.dir}/statementJdbc30.java"/>
+      <exclude name="${this.dir}/savepointJdbc30.java"/>
+      <exclude name="${this.dir}/xaJNDI.java"/>
     </javac>
   </target>
 
@@ -88,13 +95,18 @@
         <pathelement path="${java14compile.classpath}"/>
       </classpath>
       <!--exclude name=""/-->
+      <include name="${this.dir}/autoGeneratedJdbc30.java"/>
+      <include name="${this.dir}/dbMetaDataJdbc30.java"/>
+      <include name="${this.dir}/checkDataSource30.java"/>
       <include name="${this.dir}/savepointJdbc30.java"/>
       <include name="${this.dir}/dataSourcePermissions.java"/>
       <include name="${this.dir}/parameterMetaDataJdbc30.java"/>
+      <include name="${this.dir}/resultsetJdbc30.java"/>
+      <include name="${this.dir}/statementJdbc30.java"/>
     </javac>
   </target>
 
-  <target name="compilet3">
+  <target name="compilex">
     <javac
       bootclasspath="${empty}"
       nowarn="on"
@@ -107,11 +119,14 @@
       srcdir="${derby.testing.src.dir}"
       destdir="${out.dir}">
       <classpath>
-        <pathelement path="${java14compile.classpath}"/>
+        <pathelement location="${jta1_2}"/>
+        <pathelement path="${java13compile.classpath}"/>
       </classpath>
-      <!--include name=""/-->
+      <!--exclude name=""/-->
+      <include name="${this.dir}/checkDataSource.java"/>
+      <include name="${this.dir}/xaJNDI.java"/>
     </javac>
-  </target> 
+  </target>
 
   <target name="copyfiles">
     <copy todir="${out.dir}/${derby.testing.functest.dir}/tests/jdbcapi">

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/characterStreams.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,789 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.characterStreams
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.BatchUpdateException;
+import java.sql.Connection;
+import java.sql.CallableStatement;
+import java.sql.Date;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.sql.Types;
+
+import java.io.*;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+public class characterStreams { 
+
+	private static boolean isDerbyNet;
+
+	public static void main(String[] args) {
+
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+
+		if (isDerbyNet) {
+			System.out.println("SKIP TEST FOR NOW");
+			return;
+		}
+		boolean		passed = true;
+		Connection	conn = null;
+		try {
+			System.out.println("Test characterStreams starting");
+
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			conn = ij.startJBMS();
+
+			conn.createStatement().executeUpdate("create table charstream(id int GENERATED ALWAYS AS IDENTITY primary key, c char(25), vc varchar(32532), lvc long varchar)");
+
+			setStreams(conn);
+
+			conn.close();
+
+		} catch (SQLException se) {
+			passed = false;
+			JDBCDisplayUtil.ShowSQLException(System.out, se);
+			se.printStackTrace(System.out);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception caught in main():\n");
+			System.out.println(e.getMessage());
+			e.printStackTrace(System.out);
+			passed = false;
+		}
+
+		if (passed)
+			System.out.println("PASS");
+
+		System.out.println("Test characterStreams finished");
+  }
+
+	static void setStreams(Connection conn) throws Exception {
+
+		ResultSet rs;
+
+		PreparedStatement psi = conn.prepareStatement("insert into charstream(c, vc, lvc) values(?,?,?)");
+		PreparedStatement psq = conn.prepareStatement("select id, c, {fn length(c)} AS CLEN, cast (vc as varchar(25)) AS VC, {fn length(vc)} AS VCLEN, cast (lvc as varchar(25)) AS LVC, {fn length(lvc)} AS LVCLEN from charstream where id > ? order by 1");
+
+		psi.setString(1, null);
+		psi.setString(2, null);
+		psi.setString(3, null);
+
+		// test setAsciiStream into CHAR
+		System.out.println("\nTest setAsciiStream into CHAR");
+		int maxid = getMaxId(conn);
+		setAscii(psi, 1);
+		psq.setInt(1, maxid);
+		rs = psq.executeQuery();
+		JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
+	
+
+		// Show results as various streams
+		PreparedStatement psStreams = conn.prepareStatement("SELECT id, c, vc, lvc from charstream where id > ? order by 1");
+		psStreams.setInt(1, maxid);
+		rs = psStreams.executeQuery();
+		showResultsAsciiStream(rs);
+		rs = psStreams.executeQuery();
+		showResultsCharacterStream(rs);
+		rs = psStreams.executeQuery();
+		showResultsCharacterStreamBlock(rs);
+
+		psi.setString(1, null);
+		psi.setString(2, null);
+		psi.setString(3, null);
+		// test setAsciiStream into VARCHAR
+		System.out.println("\nTest setAsciiStream into VARCHAR");
+		maxid = getMaxId(conn);
+		setAscii(psi, 2);
+		psq.setInt(1, maxid);
+		rs = psq.executeQuery();
+		JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
+		psStreams.setInt(1, maxid);
+		rs = psStreams.executeQuery();
+		showResultsAsciiStream(rs);
+		rs = psStreams.executeQuery();
+		showResultsCharacterStream(rs);
+		rs = psStreams.executeQuery();
+		showResultsCharacterStreamBlock(rs);
+
+		psi.setString(1, null);
+		psi.setString(2, null);
+		psi.setString(3, null);
+		// test setAsciiStream into LONG VARCHAR
+		System.out.println("\nTest setAsciiStream into LONG VARCHAR");
+		maxid = getMaxId(conn);
+		setAscii(psi, 3);
+		psq.setInt(1, maxid);
+		rs = psq.executeQuery();
+		JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
+		psStreams.setInt(1, maxid);
+		rs = psStreams.executeQuery();
+		showResultsAsciiStream(rs);
+		rs = psStreams.executeQuery();
+		showResultsCharacterStream(rs);
+		rs = psStreams.executeQuery();
+		showResultsCharacterStreamBlock(rs);
+
+		psi.setString(1, null);
+		psi.setString(2, null);
+		psi.setString(3, null);
+
+		// test setCharacterStream into CHAR
+		System.out.println("\nTest setCharacterStream into CHAR");
+		maxid = getMaxId(conn);
+		setCharacter(psi, 1);
+		psq.setInt(1, maxid);
+		rs = psq.executeQuery();
+		JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
+
+		psi.setString(1, null);
+		psi.setString(2, null);
+		psi.setString(3, null);
+
+		// test setCharacterStream into VARCHAR
+		System.out.println("\nTest setCharacterStream into VARCHAR");
+		maxid = getMaxId(conn);
+		setCharacter(psi, 2);
+		psq.setInt(1, maxid);
+		rs = psq.executeQuery();
+		JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
+
+		psi.setString(1, null);
+		psi.setString(2, null);
+		psi.setString(3, null);
+
+		// test setCharacterStream into LONG VARCHAR
+		System.out.println("\nTest setCharacterStream into LONG VARCHAR");
+		maxid = getMaxId(conn);
+		setCharacter(psi, 3);
+		psq.setInt(1, maxid);
+		rs = psq.executeQuery();
+		JDBCDisplayUtil.DisplayResults(System.out, rs, conn);
+
+		// now insert long values using streams and check them programatically.
+		PreparedStatement psDel = conn.prepareStatement("DELETE FROM charstream");
+		PreparedStatement psq2 = conn.prepareStatement("select c, vc, lvc from charstream");
+
+		// now insert long values using streams and check them programatically.
+		System.out.println("setAsciiStream(LONG ASCII STREAMS)");
+		checkAsciiStreams(psDel, psi, psq2, 18, 104, 67);
+		checkAsciiStreams(psDel, psi, psq2, 25, 16732, 14563);
+		checkAsciiStreams(psDel, psi, psq2, 1, 32433, 32673);
+		checkAsciiStreams(psDel, psi, psq2, 0, 32532, 32700);
+
+		System.out.println("setCharacterStream(LONG CHARACTER STREAMS WITH UNICODE)");
+		checkCharacterStreams(psDel, psi, psq2, 14, 93, 55);
+		checkCharacterStreams(psDel, psi, psq2, 25, 19332, 18733);
+		checkCharacterStreams(psDel, psi, psq2, 1, 32433, 32673);
+		checkCharacterStreams(psDel, psi, psq2, 0, 32532, 32700);
+	}
+
+	private static int getMaxId(Connection conn) throws SQLException {
+
+		ResultSet rs = conn.createStatement().executeQuery("select max(id) from charstream");
+		rs.next();
+		int maxid = rs.getInt(1);
+		rs.close();
+		return maxid;
+	}
+
+	private static void setAscii(PreparedStatement ps, int targetCol) throws Exception {
+
+		// correct byte count
+		System.out.println("CORRECT NUMBER OF BYTES IN STREAM");
+		ps.setAsciiStream(targetCol, new java.io.ByteArrayInputStream("Lieberman ran with Gore".getBytes("US-ASCII")), 23);
+		ps.executeUpdate();
+
+		// less bytes than stream contains. JDBC 3.0 indicates it should throw an exception
+		// (in Tutorial & reference book)
+		System.out.println("MORE BYTES IN STREAM THAN PASSED IN VALUE");
+		try {
+			ps.setAsciiStream(targetCol, new java.io.ByteArrayInputStream("against Republicans George W. Bush ".getBytes("US-ASCII")), 19);
+			ps.executeUpdate();
+			System.out.println("FAIL - MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - ACCEPTED");
+		} catch (SQLException sqle) {
+			System.out.println("MORE BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED " + sqle.toString());
+		}
+
+		// more bytes than the stream contains
+		// JDBC 3.0 changed to indicate an exception should be thrown. (in Tutorial & reference book)
+		System.out.println("LESS BYTES IN STREAM THAN PASSED IN VALUE");
+		try {
+			ps.setAsciiStream(targetCol, new java.io.ByteArrayInputStream("and Dick Cheney.".getBytes("US-ASCII")), 17);
+			ps.executeUpdate();
+			System.out.println("FAIL - LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - ACCEPTED");
+		} catch (SQLException sqle) {
+			System.out.println("LESS BYTES IN ASCII STREAM THAN SPECIFIED LENGTH - REJECTED " + sqle.toString());
+		}
+
+		// null
+		System.out.println("NULL ASCII STREAM");
+		ps.setAsciiStream(targetCol, null, 1);
+		ps.executeUpdate();
+
+	}
+
+	private static void setCharacter(PreparedStatement ps, int targetCol) throws Exception {
+
+		// correct character count
+		ps.setCharacterStream(targetCol, new java.io.StringReader("A Mississippi Republican"), 24);
+		ps.executeUpdate();
+
+		ps.setCharacterStream(targetCol, new java.io.StringReader("Lott has apologized"), 19);
+		ps.executeUpdate();
+
+		// less bytes than stream contains.
+		try {
+			ps.setCharacterStream(targetCol, new java.io.StringReader("for comments he made at"), 20);
+			ps.executeUpdate();
+			System.out.println("FAIL - MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - ACCEPTED");
+		} catch (SQLException sqle) {
+			System.out.println("MORE CHARACTERS IN READER THAN SPECIFIED LENGTH - REJECTED " + sqle.toString());
+		}
+
+		// more bytes than the stream contains,
+		// JDBC 3.0 changed to indicate an exception should be thrown.
+		try {
+			ps.setCharacterStream(targetCol, new java.io.StringReader("a birthday party"), 17);
+			ps.executeUpdate();
+			System.out.println("FAIL - LESS CHARACTERS IN READER THAN SPECIFIED LENGTH - ACCEPTED");
+		} catch (SQLException sqle) {
+			System.out.println("LESS CHARACTERS IN READER STREAM THAN SPECIFIED LENGTH - REJECTED " + sqle.toString());
+		}
+
+		// null
+		ps.setCharacterStream(targetCol, null, 1);
+		ps.executeUpdate();
+
+	}
+
+	private static void showResultsAsciiStream(ResultSet rs) throws SQLException, java.io.IOException {
+
+		System.out.println("Results from ASCII stream");
+		while (rs.next()) {
+			System.out.print(rs.getInt(1));
+			System.out.print(",");
+			showAsciiStream(rs.getAsciiStream(2));
+			System.out.print(",");
+			showAsciiStream(rs.getAsciiStream(3));
+			System.out.print(",");
+			showAsciiStream(rs.getAsciiStream(4));
+			System.out.println("");
+		}
+		rs.close();
+	}
+
+	private static void showAsciiStream(java.io.InputStream is) throws java.io.IOException {
+
+		if (is == null) {
+			System.out.print("<NULL>");
+			return;
+		}
+
+		StringBuffer sb = new StringBuffer();
+		for (;;) {
+
+			int b = is.read();
+			if (b == -1)
+				break;
+
+			sb.append((char) b);
+		}
+
+		System.out.print(sb.toString());
+	}
+	private static void showResultsCharacterStream(ResultSet rs) throws SQLException, java.io.IOException {
+
+		System.out.println("Results from Character Stream (read char) stream");
+		while (rs.next()) {
+			System.out.print(rs.getInt(1));
+			System.out.print(",");
+			showCharacterStream(rs.getCharacterStream(2));
+			System.out.print(",");
+			showCharacterStream(rs.getCharacterStream(3));
+			System.out.print(",");
+			showCharacterStream(rs.getCharacterStream(4));
+			System.out.println("");
+		}
+		rs.close();
+	}
+	private static void showResultsCharacterStreamBlock(ResultSet rs) throws SQLException, java.io.IOException {
+
+		System.out.println("Results from Character Stream (read block) stream");
+		while (rs.next()) {
+			System.out.print(rs.getInt(1));
+			System.out.print(",");
+			showCharacterStreamBlock(rs.getCharacterStream(2));
+			System.out.print(",");
+			showCharacterStreamBlock(rs.getCharacterStream(3));
+			System.out.print(",");
+			showCharacterStreamBlock(rs.getCharacterStream(4));
+			System.out.println("");
+		}
+		rs.close();
+	}
+	private static void showCharacterStream(java.io.Reader r) throws java.io.IOException {
+
+		if (r == null) {
+			System.out.print("<NULL>");
+			return;
+		}
+
+		StringBuffer sb = new StringBuffer();
+		for (;;) {
+
+			int b = r.read();
+			if (b == -1)
+				break;
+
+			sb.append((char) b);
+		}
+
+		System.out.print(sb.toString());
+	}
+	private static void showCharacterStreamBlock(java.io.Reader r) throws java.io.IOException {
+
+		if (r == null) {
+			System.out.print("<NULL>");
+			return;
+		}
+
+		char[] buf = new char[2];
+
+		StringBuffer sb = new StringBuffer();
+		for (;;) {
+
+			int read = r.read(buf, 0, buf.length);
+			if (read == -1)
+				break;
+
+			sb.append(buf, 0, read);
+		}
+
+		System.out.print(sb.toString());
+	}
+
+	private static void checkAsciiStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2,
+				int cl, int vcl, int lvcl)
+				throws SQLException, java.io.IOException {
+
+		psDel.executeUpdate();
+
+		// now insert long values using streams and check them programatically.
+		psi.setAsciiStream(1, new c3AsciiStream(cl), cl);
+		psi.setAsciiStream(2, new c3AsciiStream(vcl), vcl);
+		psi.setAsciiStream(3, new c3AsciiStream(lvcl), lvcl);
+		psi.executeUpdate();
+
+		ResultSet rs = psq2.executeQuery();
+		rs.next();
+
+		InputStream is = rs.getAsciiStream(1);
+		System.out.print("AS-CHAR-" + cl + " ");
+		c3AsciiStream.check(is, cl, 25);
+		System.out.println("DONE");
+
+		is = rs.getAsciiStream(2);
+		System.out.print("AS-VARCHAR-" + vcl + " ");
+		c3AsciiStream.check(is, vcl, -1);
+		System.out.println("DONE");
+
+		is = rs.getAsciiStream(3);
+		System.out.print("AS-LONG VARCHAR-" + lvcl + " ");
+		c3AsciiStream.check(is, lvcl, -1);
+		System.out.println("DONE");
+
+		rs.close();
+		
+		rs = psq2.executeQuery();
+		rs.next();
+
+		Reader r = rs.getCharacterStream(1);
+		System.out.print("CS-CHAR-" + cl + " ");
+		c3AsciiStream.check(r, cl, 25);
+		System.out.println("DONE");
+
+		r = rs.getCharacterStream(2);
+		System.out.print("CS-VARCHAR-" + vcl + " ");
+		c3AsciiStream.check(r, vcl, -1);
+		System.out.println("DONE");
+
+		r = rs.getCharacterStream(3);
+		System.out.print("CS-LONG VARCHAR-" + lvcl + " ");
+		c3AsciiStream.check(r, lvcl, -1);
+		System.out.println("DONE");
+
+		rs.close();
+
+		// and check as Strings
+
+		rs = psq2.executeQuery();
+		rs.next();
+
+		r = new java.io.StringReader(rs.getString(1));
+		System.out.print("ST-CHAR-" + cl + " ");
+		c3AsciiStream.check(r, cl, 25);
+		System.out.println("DONE");
+
+		r = new java.io.StringReader(rs.getString(2));
+		System.out.print("ST-VARCHAR-" + vcl + " ");
+		c3AsciiStream.check(r, vcl, -1);
+		System.out.println("DONE");
+
+		r = new java.io.StringReader(rs.getString(3));
+		System.out.print("ST-LONG VARCHAR-" + lvcl + " ");
+		c3AsciiStream.check(r, lvcl, -1);
+		System.out.println("DONE");
+
+		rs.close();
+		}
+
+	private static void checkCharacterStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2,
+				int cl, int vcl, int lvcl)
+				throws SQLException, java.io.IOException {
+
+		psDel.executeUpdate();
+
+		psi.setCharacterStream(1, new c3Reader(cl), cl);
+		psi.setCharacterStream(2, new c3Reader(vcl), vcl);
+		psi.setCharacterStream(3, new c3Reader(lvcl), lvcl);
+		psi.executeUpdate();
+
+		ResultSet rs = psq2.executeQuery();
+		rs.next();
+
+		InputStream is = rs.getAsciiStream(1);
+		System.out.print("AS-CHAR-" + cl + " ");
+		c3Reader.check(is, cl, 25);
+		System.out.println("DONE");
+
+		is = rs.getAsciiStream(2);
+		System.out.print("AS-VARCHAR-" + vcl + " ");
+		c3Reader.check(is, vcl, -1);
+		System.out.println("DONE");
+
+		is = rs.getAsciiStream(3);
+		System.out.print("AS-LONG VARCHAR-" + lvcl + " ");
+		c3Reader.check(is, lvcl, -1);
+		System.out.println("DONE");
+
+		rs.close();
+		
+		rs = psq2.executeQuery();
+		rs.next();
+
+		Reader r = rs.getCharacterStream(1);
+		System.out.print("CS-CHAR-" + cl + " ");
+		c3Reader.check(r, cl, 25);
+		System.out.println("DONE");
+
+		r = rs.getCharacterStream(2);
+		System.out.print("CS-VARCHAR-" + vcl + " ");
+		c3Reader.check(r, vcl, -1);
+		System.out.println("DONE");
+
+		r = rs.getCharacterStream(3);
+		System.out.print("CS-LONG VARCHAR-" + lvcl + " ");
+		c3Reader.check(r, lvcl, -1);
+		System.out.println("DONE");
+
+		rs.close();
+
+		// check converting them into Strings work
+		rs = psq2.executeQuery();
+		rs.next();
+
+		String suv = rs.getString(1);
+		r = new java.io.StringReader(suv);
+		System.out.print("ST-CHAR-" + cl + " ");
+		c3Reader.check(r, cl, 25);
+		System.out.println("DONE");
+
+		suv = rs.getString(2);
+		r = new java.io.StringReader(suv);
+		System.out.print("ST-VARCHAR-" + vcl + " ");
+		c3Reader.check(r, vcl, -1);
+		System.out.println("DONE");
+
+		suv = rs.getString(3);
+		r = new java.io.StringReader(suv);
+		System.out.print("ST-LONG VARCHAR-" + lvcl + " ");
+		c3Reader.check(r, lvcl, -1);
+		System.out.println("DONE");
+
+		rs.close();
+
+		}
+}
+
+class c3AsciiStream extends java.io.InputStream {
+
+	private final int size;
+	private int count;
+	c3AsciiStream(int size) {
+		this.size = size;
+	}
+	public int read(byte[] buf, int off, int length) {
+		if (count >= size)
+			return -1;
+
+		if (length > (size - count))
+			length = (size - count);
+
+		// ensure the readers don't always get a full buffer,
+		// makes sure they are not assuming the buffer will be filled.
+
+		if (length > 20)
+			length -= 17;
+
+		for (int i = 0; i < length ; i++) {
+			buf[off + i] = (byte) count++;
+		}
+
+		return length;
+	}
+
+	private byte[] rd = new byte[1];
+	public int read() {
+
+		int read = read(rd, 0, 1);
+		if (read == -1)
+			return -1;
+		return rd[0] & 0xFF;
+	}
+
+	public void close() {
+	}
+
+	static void check(InputStream is, int length, int fixedLen) throws java.io.IOException {
+
+		InputStream orig = new c3AsciiStream(length);
+
+		int count = 0;
+		for (;;) {
+
+			int o = orig == null ? (count == fixedLen ? -2 : 0x20) : orig.read();
+			int c = is.read();
+			if (o == -1) {
+				orig = null;
+				if (fixedLen != -1 && fixedLen != length)
+					o = ' ';
+			}
+			if (o == -2)
+				o = -1;
+
+			if ((byte) o != (byte) c) {
+				System.out.print("F@" + count +"("+((byte)o)+","+((byte)c)+")");
+			}
+			if (orig == null) {
+				if (fixedLen == -1)
+					break;
+			}
+
+			if (c == -1 && fixedLen != -1)
+				break;
+			
+			count++;
+		}
+		if (fixedLen != -1)
+			length = fixedLen;
+
+		if (count != length) {
+			System.out.print("FAIL-LEN" + count + " expected " + length);
+		}
+		is.close();
+	}
+	static void check(Reader r, int length, int fixedLen) throws java.io.IOException {
+
+		InputStream orig = new c3AsciiStream(length);
+
+		int count = 0;
+		for (;;) {
+
+			int o = orig == null ? (count == fixedLen ? -2 : 0x20) : orig.read();
+			int c = r.read();
+			if (o == -1) {
+				orig = null;
+				if (fixedLen != -1 && fixedLen != length)
+					o = ' ';
+			}
+			if (o == -2)
+				o = -1;
+
+			if (o != c) {
+				System.out.print("F@" + count +"("+o+","+c+")");
+			}
+			if (orig == null) {
+				if (fixedLen == -1)
+					break;
+			}
+
+			if (c == -1 && fixedLen != -1)
+				break;
+			
+			count++;
+		}
+		if (fixedLen != -1)
+			length = fixedLen;
+
+		if (count != length) {
+			System.out.print("FAIL-LEN" + count + " expected " + length);
+		}
+		r.close();
+	}
+}
+
+class c3Reader extends java.io.Reader {
+
+	private final int size;
+	private int count;
+	c3Reader(int size) {
+		this.size = size;
+	}
+	public int read(char[] buf, int off, int length) {
+		if (count >= size)
+			return -1;
+
+		if (length > (size - count))
+			length = (size - count);
+
+		// ensure the readers don't always get a full buffer,
+		// makes sure they are not assuming the buffer will be filled.
+
+		if (length > 20)
+			length -= 17;
+
+		for (int i = 0; i < length ; i++) {
+			char c;
+			switch (count % 3) {
+			case 0:
+				c = (char) (count & 0x7F); // one byte UTF8
+				break;
+			case 1:
+				c = (char) ((count + 0x7F) & 0x07FF); // two byte UTF8
+				break;
+			default:
+			case 2:
+				c = (char) (count + 0x07FF); // three byte UTF8
+				break;
+
+			}
+			buf[off + i] = c;
+			count++;
+		}
+		return length;
+	}
+
+	public void close() {
+	}
+	static void check(InputStream is, int length, int fixedLen) throws java.io.IOException {
+
+		Reader orig = new c3Reader(length);
+
+		int count = 0;
+		for (;;) {
+
+			int o = orig == null ? (count == fixedLen ? -2 : 0x20) : orig.read();
+			int c = is.read();
+			if (o == -1) {
+				orig = null;
+				if (fixedLen != -1 && fixedLen != length)
+					o = ' ';
+			}
+			if (o == -2)
+				o = -1;
+
+			if (o != -1) {
+				if (o <= 255)
+					o = o & 0xFF; // convert to single byte exended ASCII
+				else
+					o = '?'; // out of range character.
+			}
+
+			if (o != c) {
+				System.out.print("F@" + count +"("+o+","+c+")");
+			}
+			if (orig == null) {
+				if (fixedLen == -1)
+					break;
+			}
+
+			if (c == -1 && fixedLen != -1)
+				break;
+			
+			count++;
+		}
+		if (fixedLen != -1)
+			length = fixedLen;
+
+		if (count != length) {
+			System.out.print("FAIL-LEN" + count + " expected " + length);
+		}
+		is.close();
+	}
+	static void check(Reader r, int length, int fixedLen) throws java.io.IOException {
+
+		Reader orig = new c3Reader(length);
+
+		int count = 0;
+		for (;;) {
+
+			int o = orig == null ? (count == fixedLen ? -2 : 0x20) : orig.read();
+			int c = r.read();
+			if (o == -1) {
+				orig = null;
+				if (fixedLen != -1 && fixedLen != length)
+					o = ' ';
+			}
+			if (o == -2)
+				o = -1;
+
+			if (o != c) {
+				System.out.print("F@" + count +"("+o+","+c+")");
+			}
+			if (orig == null) {
+				if (fixedLen == -1)
+					break;
+			}
+
+			if (c == -1 && fixedLen != -1)
+				break;
+			
+			count++;
+		}
+		if (fixedLen != -1)
+			length = fixedLen;
+
+		if (count != length) {
+			System.out.print("FAIL-LEN" + count + " expected " + length);
+		}
+		r.close();
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1308 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import org.apache.derby.jdbc.EmbeddedDataSource;
+import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource;
+import org.apache.derby.jdbc.EmbeddedXADataSource;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.PreparedStatement;
+import java.sql.CallableStatement;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.DriverManager;
+
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+import javax.sql.PooledConnection;
+import javax.sql.XAConnection;
+import javax.sql.ConnectionPoolDataSource;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+import javax.sql.ConnectionEventListener;
+import javax.sql.ConnectionEvent;
+import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derby.tools.ij;
+
+import java.io.*;
+import java.util.Hashtable;
+
+import javax.naming.*;
+import javax.naming.directory.*;
+
+public class checkDataSource
+{ 
+
+	public static void main(String[] args) throws Exception {
+
+		new checkDataSource().runTest(args);
+		System.out.println("Completed checkDataSource");
+
+	}
+
+
+	public checkDataSource() throws Exception {
+	}
+
+	protected void runTest(String[] args) throws Exception {
+
+		// Check the returned type of the JDBC Connections.
+		ij.getPropertyArg(args);
+		Connection dmc = ij.startJBMS();
+
+		dmc.createStatement().executeUpdate("create table y(i int)");
+
+		dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20)) parameter style java language java modifies SQL Data external name 'org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource.checkNesConn'");
+		CallableStatement cs = dmc.prepareCall("call checkConn2(?)");
+		cs.setString(1,"Nested");
+		cs.execute();
+		
+
+		checkConnection("DriverManager ", dmc);
+
+
+		EmbeddedDataSource dscs = new EmbeddedDataSource();
+		dscs.setDatabaseName("wombat");
+
+		DataSource ds = dscs;
+
+		checkConnection("EmbeddedDataSource", ds.getConnection());
+
+		EmbeddedConnectionPoolDataSource dscsp = new EmbeddedConnectionPoolDataSource();
+		dscsp.setDatabaseName("wombat");
+		//dscsp.setConnectionAttributes("unicode=true");
+		ConnectionPoolDataSource dsp = dscsp;
+
+		PooledConnection pc = dsp.getPooledConnection();
+		pc.addConnectionEventListener(new EventCatcher(1));
+
+		checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
+		checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
+
+		// BUG 4471 - check outstanding updates are rolled back.
+		Connection c1 = pc.getConnection();
+
+		Statement s = c1.createStatement();
+
+		s.executeUpdate("create table t (i int)");
+
+		s.executeUpdate("insert into t values(1)");
+
+		c1.setAutoCommit(false);
+
+		// this update should be rolled back
+		s.executeUpdate("insert into t values(2)");
+
+		c1 = pc.getConnection();
+
+		ResultSet rs = c1.createStatement().executeQuery("select count(*) from t");
+		rs.next();
+		int count = rs.getInt(1);
+
+		System.out.println(count == 1 ? "Changes rolled back OK in auto closed pooled connection" :
+				("FAIL changes committed in in auto closed pooled connection - " + count));
+
+		c1.close();
+
+		// check connection objects are closed once connection is closed
+		try {
+			rs.next();
+			System.out.println("FAIL - ResultSet is open for a closed connection obtained from PooledConnection");
+		} catch (SQLException sqle) {
+			System.out.println("expected " + sqle.toString());
+		}
+
+		try {
+			s.executeUpdate("update t set i = 1");
+			System.out.println("FAIL - Statement is open for a closed connection obtained from PooledConnection");
+		} catch (SQLException sqle) {
+			System.out.println("expected " + sqle.toString());
+		}
+
+		pc.close();
+		pc = null;
+
+
+
+
+		EmbeddedXADataSource dscsx = new EmbeddedXADataSource();
+		dscsx.setDatabaseName("wombat");
+		//dscsx.setConnectionAttributes("unicode=true");
+
+		XADataSource dsx = dscsx;
+
+		XAConnection xac = dsx.getXAConnection();
+		xac.addConnectionEventListener(new EventCatcher(3));
+
+		checkConnection("EmbeddedXADataSource", xac.getConnection());
+
+		// BUG 4471 - check outstanding updates are rolled back wi XAConnection.
+		c1 = xac.getConnection();
+
+		s = c1.createStatement();
+
+		s.executeUpdate("insert into t values(1)");
+
+		c1.setAutoCommit(false);
+
+		// this update should be rolled back
+		s.executeUpdate("insert into t values(2)");
+
+		c1 = xac.getConnection();
+
+		rs = c1.createStatement().executeQuery("select count(*) from t");
+		rs.next();
+		count = rs.getInt(1);
+		rs.close();
+
+		System.out.println(count == 2 ? "Changes rolled back OK in auto closed local XAConnection" :
+				("FAIL changes committed in in auto closed pooled connection - " + count));
+
+		c1.close();
+		xac.close();
+		xac = null;
+
+
+		try {
+			DriverManager.getConnection("jdbc:derby:;shutdown=true");
+		} catch (SQLException sqle) {
+			JDBCDisplayUtil.ShowSQLException(System.out, sqle);
+		}
+
+		dmc = ij.startJBMS();
+
+		cs = dmc.prepareCall("call checkConn2(?)");
+		cs.setString(1,"Nested");
+		cs.execute();
+		
+
+		checkConnection("DriverManager ", dmc);
+
+		checkConnection("EmbeddedDataSource", ds.getConnection());
+
+		pc = dsp.getPooledConnection();
+		pc.addConnectionEventListener(new EventCatcher(2));
+		checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
+		checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
+
+		// test "local" XAConnections
+		xac = dsx.getXAConnection();
+		xac.addConnectionEventListener(new EventCatcher(4));
+		checkConnection("EmbeddedXADataSource", xac.getConnection());
+		checkConnection("EmbeddedXADataSource", xac.getConnection());
+		xac.close();
+
+		// test "global" XAConnections
+		xac = dsx.getXAConnection();
+		xac.addConnectionEventListener(new EventCatcher(5));
+		XAResource xar = xac.getXAResource();
+		Xid xid = new cdsXid(1, (byte) 35, (byte) 47);
+		xar.start(xid, XAResource.TMNOFLAGS);
+		Connection xacc = xac.getConnection();
+		xacc.close();
+		checkConnection("Global EmbeddedXADataSource", xac.getConnection());
+		checkConnection("Global EmbeddedXADataSource", xac.getConnection());
+
+		xar.end(xid, XAResource.TMSUCCESS);
+
+		checkConnection("Switch to local EmbeddedXADataSource", xac.getConnection());
+		checkConnection("Switch to local EmbeddedXADataSource", xac.getConnection());
+
+		Connection backtoGlobal = xac.getConnection();
+
+		xar.start(xid, XAResource.TMJOIN);
+		checkConnection("Switch to global EmbeddedXADataSource", backtoGlobal);
+		checkConnection("Switch to global EmbeddedXADataSource", xac.getConnection());
+		xar.end(xid, XAResource.TMSUCCESS);
+		xar.commit(xid, true);
+
+		xac.close();
+
+		// now some explicit tests for how connection state behaves
+		// when switching between global transactions and local
+		// and setting connection state.
+		// some of this is already tested in simpleDataSource and checkDataSource
+		// but I want to make sure I cover all situations. (djd)
+		xac = dsx.getXAConnection();
+		xac.addConnectionEventListener(new EventCatcher(6));
+		xar = xac.getXAResource();
+		xid = new cdsXid(1, (byte) 93, (byte) 103);
+
+		// series 1 - Single connection object
+		Connection cs1 = xac.getConnection();
+		printState("initial local", cs1);
+		xar.start(xid, XAResource.TMNOFLAGS);
+		printState("initial  X1", cs1);
+		cs1.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+		cs1.setReadOnly(true);
+		setHoldability(cs1, false);
+		printState("modified X1", cs1);
+		xar.end(xid, XAResource.TMSUCCESS);
+		// the underlying local transaction/connection must pick up the
+		// state of the Connection handle cs1
+		printState("modified local", cs1);
+		cs1.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+		cs1.setReadOnly(false);
+		setHoldability(cs1, false);
+
+		printState("reset local", cs1);
+
+		// now re-join the transaction, should pick up the read-only
+		// and isolation level from the transaction,
+		// holdability remains that of this handle.
+		xar.start(xid, XAResource.TMJOIN);
+		printState("re-join X1", cs1);
+		xar.end(xid, XAResource.TMSUCCESS);
+
+		// should be the same as the reset local
+		printState("back to local (same as reset)", cs1);
+
+		cs1.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+		cs1.setReadOnly(true);
+		setHoldability(cs1, true);
+		cs1.close();
+
+		cs1 = xac.getConnection();
+		printState("new handle - local ", cs1);
+		cs1.close();
+
+		xar.start(xid, XAResource.TMJOIN);
+		cs1 = xac.getConnection();
+		printState("re-join with new handle X1", cs1);
+		cs1.close();
+		xar.end(xid, XAResource.TMSUCCESS);
+
+		// now get a connection (attached to a local)
+		// attach to the global and commit it.
+		// state should be that of the local after the commit.
+		cs1 = xac.getConnection();
+		cs1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
+		printState("pre-X1 commit - local", cs1);
+		xar.start(xid, XAResource.TMJOIN);
+		printState("pre-X1 commit - X1", cs1);
+		xar.end(xid, XAResource.TMSUCCESS);
+		printState("post-X1 end - local", cs1);
+		xar.commit(xid, true);
+		printState("post-X1 commit - local", cs1);
+		cs1.close();
+
+
+		// now check re-use of *Statement objects across local/global connections.
+		System.out.println("TESTING RE_USE OF STATEMENT OBJECTS");
+		System.out.println("THE STATEMENT OBJECTS CAN NOT BE REUSED ACROSS LOCAL/GLOBAL CONNECTIONS BECAUSE, LOCAL CONNECTION CREATES THEM");
+		System.out.println("WITH HOLDABILITY TRUE WHEREAS GLOBAL CONNECTION CAN ONLY WORK WITH STATEMENTS WITH HOLDABILITY FALSE");
+		cs1 = xac.getConnection();
+
+    
+		// ensure read locsk stay around until end-of transaction
+		cs1.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
+		cs1.setAutoCommit(false);
+
+		checkLocks(cs1);
+		Statement sru1 = cs1.createStatement();
+		sru1.setCursorName("SN1");
+		sru1.executeUpdate("create table ru(i int)");
+		sru1.executeUpdate("insert into ru values 1,2,3");
+		Statement sruBatch = cs1.createStatement();
+		Statement sruState = createFloatStatementForStateChecking(cs1);
+		PreparedStatement psruState = createFloatStatementForStateChecking(cs1, "select i from ru where i = ?");
+		CallableStatement csruState = createFloatCallForStateChecking(cs1, "CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)");
+		PreparedStatement psParams = cs1.prepareStatement("select * from ru where i > ?");
+		psParams.setCursorName("params");
+		psParams.setInt(1, 2);
+		resultSetQuery("Params-local-1", psParams.executeQuery());
+
+		sruBatch.addBatch("insert into ru values 4");
+		queryOnStatement("sru1-local-1", cs1, sru1);
+		cs1.commit(); // need to commit to switch to an global connection;
+		xid = new cdsXid(1, (byte) 103, (byte) 119);
+		xar.start(xid, XAResource.TMNOFLAGS); // simple case - underlying connection is re-used for global.
+		System.out.println("Expecting exception because global transaction sru1-global-2 is trying to use a statement with holdability true");
+		queryOnStatement("sru1-global-2", cs1, sru1);
+		sruBatch.addBatch("insert into ru values 5");
+		Statement sru2 = cs1.createStatement();
+		sru2.setCursorName("OAK2");
+		queryOnStatement("sru2-global-3", cs1, sru2);
+		System.out.println("Expecting exception because global transaction sru1-global-4 is trying to use a statement with holdability true");
+		queryOnStatement("sru1-global-4", cs1, sru1);
+		showStatementState("GLOBAL ", sruState);
+		showStatementState("PS GLOBAL ", psruState);
+		showStatementState("CS GLOBAL ", csruState);
+		try {
+			resultSetQuery("Params-global-1", psParams.executeQuery());
+			System.out.println("FAIL: should have gotten exception because holdability is true on prepared statement and that is not allowed in global transactions");
+		} catch (SQLException ex) {
+			System.out.println("PASS: got exception because holdability is true on prepared statement and that is not allowed in global transactions");
+			System.out.println(ex.getMessage());
+		}
+
+		xar.end(xid, XAResource.TMSUCCESS);
+		// now a new underlying connection is created
+		queryOnStatement("sru1-local-5", cs1, sru1);
+		queryOnStatement("sru2-local-6", cs1, sru2);
+		sruBatch.addBatch("insert into ru values 6,7");
+		Statement sru3 = cs1.createStatement();
+		sru3.setCursorName("SF3");
+		queryOnStatement("sru3-local-7", cs1, sru3);
+		// Two transactions should hold locks (global and the current XA);
+		showStatementState("LOCAL ", sruState);
+		showStatementState("PS LOCAL ", psruState);
+		showStatementState("CS LOCAL ", csruState);
+		resultSetQuery("Params-local-2", psParams.executeQuery());
+		checkLocks(cs1);
+		cs1.commit();
+
+		// attach the XA transaction to another connection and see what happens
+		XAConnection xac2 = dsx.getXAConnection();
+		xac2.addConnectionEventListener(new EventCatcher(5));
+		XAResource xar2 = xac2.getXAResource();
+
+		xar2.start(xid, XAResource.TMJOIN);
+		Connection cs2 = xac2.getConnection();
+
+		// these statements were generated by cs1 and thus are still
+		// in a local connection.
+		queryOnStatement("sru1-local-8", cs1, sru1);
+		queryOnStatement("sru2-local-9", cs1, sru2);
+		queryOnStatement("sru3-local-10", cs1, sru3);
+		sruBatch.addBatch("insert into ru values 8");
+		showStatementState("LOCAL 2 ", sruState);
+		showStatementState("PS LOCAL 2 ", psruState);
+		showStatementState("CS LOCAL 2", csruState);
+
+		checkLocks(cs1);
+
+		int[] updateCounts = sruBatch.executeBatch();
+		System.out.print("sruBatch update counts :");
+		for (int i = 0; i < updateCounts.length; i++) {
+			System.out.print(" " + updateCounts[i] + " ");
+		}
+		System.out.println(":");
+		queryOnStatement("sruBatch", cs1, sruBatch);
+
+
+		xar2.end(xid, XAResource.TMSUCCESS);
+
+		xac2.close();
+
+		// allow close on already closed XAConnection
+		xac2.close();
+		xac2.addConnectionEventListener(null);
+		xac2.removeConnectionEventListener(null);
+
+		// test methods against a closed XAConnection and its resource
+		try {
+			xac2.getXAResource();
+		} catch (SQLException sqle) {
+			System.out.println("XAConnection.getXAResource : " + sqle.getMessage());
+		}
+		try {
+			xac2.getConnection();
+		} catch (SQLException sqle) {
+			System.out.println("XAConnection.getConnection : " + sqle.getMessage());
+		}
+		try {
+			xar2.start(xid, XAResource.TMJOIN);
+		} catch (XAException xae) {
+			showXAException("XAResource.start", xae);
+		}
+
+		try {
+			xar2.end(xid, XAResource.TMJOIN);
+		} catch (XAException xae) {
+			showXAException("XAResource.end", xae);
+		}
+		try {
+			xar2.commit(xid, true);
+		} catch (XAException xae) {
+			showXAException("XAResource.commit", xae);
+		}
+		try {
+			xar2.prepare(xid);
+		} catch (XAException xae) {
+			showXAException("XAResource.prepare", xae);
+		}
+		try {
+			xar2.recover(0);
+		} catch (XAException xae) {
+			showXAException("XAResource.recover", xae);
+		}
+		try {
+			xar2.prepare(xid);
+		} catch (XAException xae) {
+			showXAException("XAResource.prepare", xae);
+		}
+		try {
+			xar2.isSameRM(xar2);
+		} catch (XAException xae) {
+			showXAException("XAResource.isSameRM", xae);
+		}
+
+		// Patricio (on the forum) one was having an issue with set schema not working in an XA connection.
+		dmc = ij.startJBMS();
+		dmc.createStatement().executeUpdate("create schema SCHEMA_Patricio");
+		dmc.createStatement().executeUpdate("create table SCHEMA_Patricio.Patricio (id VARCHAR(255), value INTEGER)");
+		dmc.commit();
+
+		dmc.close();
+
+		XAConnection xac3 = dsx.getXAConnection();
+		Connection conn3 = xac3.getConnection();
+		Statement st3 = conn3.createStatement();
+		st3.execute("SET SCHEMA SCHEMA_Patricio");
+		st3.close();
+
+		PreparedStatement ps3 = conn3.prepareStatement("INSERT INTO Patricio VALUES (? , ?)");
+		ps3.setString(1, "Patricio");
+		ps3.setInt(2, 3);
+		ps3.executeUpdate();
+
+		System.out.println("Patricio update count " + ps3.getUpdateCount());
+		ps3.close();
+		conn3.close();
+		xac3.close();
+
+		// test that an xastart in auto commit mode commits the existing work.(beetle 5178)
+		XAConnection xac4 = dsx.getXAConnection();
+		Xid xid4a = new cdsXid(4, (byte) 23, (byte) 76);
+		Connection conn4 = xac4.getConnection();
+		System.out.println("conn4 autcommit " + conn4.getAutoCommit());
+
+		Statement s4 = conn4.createStatement();
+		s4.executeUpdate("create table autocommitxastart(i int)");
+		s4.executeUpdate("insert into autocommitxastart values 1,2,3,4,5");
+
+		ResultSet rs4 = s4.executeQuery("select i from autocommitxastart");
+		rs4.next(); System.out.println("acxs " + rs4.getInt(1));
+		rs4.next(); System.out.println("acxs " + rs4.getInt(1));
+
+		xac4.getXAResource().start(xid4a, XAResource.TMNOFLAGS);
+		xac4.getXAResource().end(xid4a, XAResource.TMSUCCESS);
+
+		try {
+			rs4.next(); System.out.println("acxs " + rs.getInt(1));
+		} catch (SQLException sqle) {
+			System.out.println("autocommitxastart expected " + sqle.getMessage());
+		}
+
+		conn4.setAutoCommit(false);
+
+		rs4 = s4.executeQuery("select i from autocommitxastart");
+		rs4.next(); System.out.println("acxs " + rs4.getInt(1));
+		rs4.next(); System.out.println("acxs " + rs4.getInt(1));
+
+		try {
+			xac4.getXAResource().start(xid4a, XAResource.TMNOFLAGS);
+		} catch (XAException xae) {
+			showXAException("autocommitxastart expected ", xae);
+		}
+		rs4.next(); System.out.println("acxs " + rs4.getInt(1));
+		rs4.close();
+
+		conn4.rollback();
+		conn4.close();
+		xac4.close();
+		
+		testDSRequestAuthentication();
+	}
+
+	protected void showXAException(String tag, XAException xae) {
+
+		System.out.println(tag + " : XAException - " + xae.getMessage());
+	}
+
+	/**
+		Create a statement with modified State.
+	*/
+	protected Statement createFloatStatementForStateChecking(Connection conn) throws SQLException {
+		Statement s = internalCreateFloatStatementForStateChecking(conn);
+		s.setCursorName("StokeNewington");
+		s.setFetchDirection(ResultSet.FETCH_REVERSE);
+		s.setFetchSize(444);
+		s.setMaxFieldSize(713);
+		s.setMaxRows(19);
+
+		showStatementState("Create ", s);
+		return s;
+	}
+
+	protected Statement internalCreateFloatStatementForStateChecking(Connection conn) throws SQLException {
+		return conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
+	}
+
+	protected void showStatementState(String when, Statement s) throws SQLException {
+		System.out.println("Statement State @ " + when);
+		System.out.println("  getResultSetType() " + rsType(s.getResultSetType()));
+		System.out.println("  getResultSetConcurrency() " + rsConcurrency(s.getResultSetConcurrency()));
+		System.out.println("  getFetchDirection() " + rsFetchDirection(s.getFetchDirection()));
+		System.out.println("  getFetchSize() " + s.getFetchSize());
+		System.out.println("  getMaxFieldSize() " + s.getMaxFieldSize());
+		System.out.println("  getMaxRows() " + s.getMaxRows());
+	}
+	protected PreparedStatement createFloatStatementForStateChecking(Connection conn, String sql) throws SQLException {
+		PreparedStatement s = internalCreateFloatStatementForStateChecking(conn, sql);
+		s.setCursorName("StokeNewington");
+		s.setFetchDirection(ResultSet.FETCH_REVERSE);
+		s.setFetchSize(888);
+		s.setMaxFieldSize(317);
+		s.setMaxRows(91);
+
+		showStatementState("PS Create ", s);
+		return s;
+	}
+	protected CallableStatement createFloatCallForStateChecking(Connection conn, String sql) throws SQLException {
+		CallableStatement s = internalCreateFloatCallForStateChecking(conn, sql);
+		s.setCursorName("StokeNewington");
+		s.setFetchDirection(ResultSet.FETCH_REVERSE);
+		s.setFetchSize(999);
+		s.setMaxFieldSize(137);
+		s.setMaxRows(85);
+
+		showStatementState("CS Create ", s);
+		return s;
+	}
+	protected PreparedStatement internalCreateFloatStatementForStateChecking(Connection conn, String sql) throws SQLException {
+		return conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
+	}
+	protected CallableStatement internalCreateFloatCallForStateChecking(Connection conn, String sql) throws SQLException {
+		return conn.prepareCall(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
+	}
+
+	static String rsType(int type) {
+		switch (type) {
+		case ResultSet.TYPE_FORWARD_ONLY:
+			return "FORWARD_ONLY";
+		case ResultSet.TYPE_SCROLL_SENSITIVE:
+			return "SCROLL_SENSITIVE";
+		case ResultSet.TYPE_SCROLL_INSENSITIVE:
+			return "SCROLL_INSENSITIVE";
+		default:
+			return "?? TYPE UNKNOWN ??";
+
+		}
+	}
+
+	static String rsConcurrency(int type) {
+		switch (type) {
+		case ResultSet.CONCUR_READ_ONLY:
+			return "READ_ONLY";
+		case ResultSet.CONCUR_UPDATABLE:
+			return "UPDATEABLE";
+		default:
+			return "?? CONCURRENCY UNKNOWN ??";
+
+		}
+	}
+	static String rsFetchDirection(int type) {
+		switch (type) {
+		case ResultSet.FETCH_FORWARD:
+			return "FORWARD";
+		case ResultSet.FETCH_REVERSE:
+			return "REVERSE";
+		case ResultSet.FETCH_UNKNOWN:
+			return "UNKNOWN";
+		default:
+			return "?? FETCH DIRECTION REALLY UNKNOWN ??";
+
+		}
+	}
+	private static void checkLocks(Connection conn) throws SQLException {
+		Statement s = conn.createStatement();
+		ResultSet rs = s.executeQuery("SELECT XID, sum(cast (LOCKCOUNT AS INT)) FROM new org.apache.derby.diag.LockTable() AS L GROUP BY XID");
+		System.out.println("LOCK TABLE");
+
+        // Don't output actual XID's as they tend for every catalog change
+        // to the system.
+        int xact_index = 0;
+		while (rs.next()) {
+			// System.out.println("  xid " + rs.getString(1) + " lock count " + rs.getInt(2));
+			System.out.println("  xid row " + xact_index + " lock count " + rs.getInt(2));
+            xact_index++;
+		}
+		s.close();
+		System.out.println("END LOCK TABLE");
+	}
+
+	private static void queryOnStatement(String tag, Connection conn, Statement s) throws SQLException {
+
+		try {
+			if (s.getConnection() != conn)
+				System.out.println(tag + ": mismatched Statement connection");
+			resultSetQuery(tag, s.executeQuery("select * from ru"));
+		} catch (SQLException sqle) {
+			System.out.println(tag + ": " + sqle.toString());
+		}
+	}
+
+	private static void resultSetQuery(String tag, ResultSet rs) throws SQLException {
+		System.out.print(tag + ": ru(" + rs.getCursorName() + ") contents");
+		while (rs.next()) {
+			System.out.print(" {" + rs.getInt(1) + "}");
+		}
+		System.out.println("");
+		rs.close();
+	}
+
+	private void printState(String header, Connection conn) throws SQLException {
+		System.out.println(header);
+		getHoldability(conn);
+		System.out.println("  isolation level " + translateIso(conn.getTransactionIsolation()));
+		System.out.println("  auto commit     " + conn.getAutoCommit());
+		System.out.println("  read only       " + conn.isReadOnly());
+	}
+
+	protected void setHoldability(Connection conn, boolean hold) throws SQLException {
+	}
+
+	protected void getHoldability(Connection conn) throws SQLException {
+	}
+
+	//calling checkConnection - for use in a procedure to get a nested connection.
+	public static void checkNesConn (String dsName) throws SQLException {
+		checkConnectionS(dsName, DriverManager.getConnection("jdbc:default:connection"));
+			
+	}
+
+	public static void checkConnectionS(String dsName, Connection conn) throws SQLException {
+
+		System.out.println("Running connection checks on " + dsName);
+
+		//System.out.println("  url             " + conn.getMetaData().getURL());
+		System.out.println("  isolation level " + conn.getTransactionIsolation());
+		System.out.println("  auto commit     " + conn.getAutoCommit());
+		System.out.println("  read only       " + conn.isReadOnly());
+
+		// when 4729 is fixed, remove the startsWith() clause
+		if (dsName.endsWith("DataSource") && !dsName.startsWith("Global"))
+			System.out.println("  has warnings    " + (conn.getWarnings() != null));
+
+		checkStatementS(conn, conn.createStatement());
+		checkStatementS(conn, conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY));
+
+		Connection c1 = conn.getMetaData().getConnection();
+		if (c1 != conn)
+			System.out.println("FAIL incorrect connection object returned for DatabaseMetaData.getConnection()");
+
+		checkConnectionPreCloseS(dsName, conn);
+		conn.close();
+	}
+
+	public void checkConnection(String dsName, Connection conn) throws SQLException {
+
+		System.out.println("Running connection checks on " + dsName);
+
+		//System.out.println("  url             " + conn.getMetaData().getURL());
+		System.out.println("  isolation level " + conn.getTransactionIsolation());
+		System.out.println("  auto commit     " + conn.getAutoCommit());
+		System.out.println("  read only       " + conn.isReadOnly());
+
+		// when 4729 is fixed, remove the startsWith() clause
+		if (dsName.endsWith("DataSource") && !dsName.startsWith("Global"))
+			System.out.println("  has warnings    " + (conn.getWarnings() != null));
+
+		Statement s1 = conn.createStatement();
+		checkStatement(conn, s1);
+		checkStatement(conn, conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY));
+
+		Connection c1 = conn.getMetaData().getConnection();
+		if (c1 != conn)
+			System.out.println("FAIL incorrect connection object returned for DatabaseMetaData.getConnection()");
+
+		// Derby-33 - setTypeMap on connection
+		try {
+			conn.setTypeMap(java.util.Collections.EMPTY_MAP);
+			System.out.println("setTypeMap(EMPTY_MAP) - ok");
+		} catch (SQLException sqle) {
+			System.out.println("setTypeMap(EMPTY_MAP) - FAIL " + sqle.getSQLState() + " - " + sqle.getMessage());
+		}
+		try {
+			conn.setTypeMap(null);
+			System.out.println("setTypeMap(null) - FAIL  - should throw exception");
+		} catch (SQLException sqle) {
+			System.out.println("setTypeMap(null) - ok " + sqle.getSQLState() + " - " + sqle.getMessage());
+		}
+		try {
+			// a populated map, not implemented
+			java.util.Map map = new java.util.HashMap();
+			map.put("name", "class");
+
+			conn.setTypeMap(map);
+			System.out.println("setTypeMap(map) - FAIL  - should throw exception");
+		} catch (SQLException sqle) {
+			System.out.println("setTypeMap(map) - ok " + sqle.getSQLState() + " - " + sqle.getMessage());
+		}
+
+		checkConnectionPreClose(dsName, conn);
+		conn.close();
+
+		System.out.println("method calls on a closed connection");
+
+		try {
+			conn.close();
+			System.out.println(dsName + " <closedconn>.close() no error");
+		} catch (SQLException sqle) {
+			System.out.println(dsName + " <closedconn>.close() " + sqle.getSQLState() + " - " + sqle.getMessage());
+		}
+		try {
+			conn.createStatement();
+			System.out.println(dsName + " <closedconn>.createStatement() no error");
+		} catch (SQLException sqle) {
+			System.out.println(dsName + " <closedconn>.createStatement() " + sqle.getSQLState() + " - " + sqle.getMessage());
+		}
+		try {
+			s1.execute("values 1");
+			System.out.println(dsName + " <closedstmt>.execute() no error");
+		} catch (SQLException sqle) {
+			System.out.println(dsName + " <closedstmt>.execute() " + sqle.getSQLState() + " - " + sqle.getMessage());
+		}
+	}
+
+	protected static void checkConnectionPreCloseS(String dsName, Connection conn) throws SQLException {
+		if (dsName.endsWith("DataSource")) {
+
+			// see if setting the state is carried over to any future connection from the
+			// data source object.
+			try {
+				conn.setReadOnly(true);
+			} catch (SQLException sqle) {
+				// cannot set read-only in an active transaction, & sometimes
+				// connections are active at this point.
+			}
+		}
+	}
+
+	protected void checkConnectionPreClose(String dsName, Connection conn) throws SQLException {
+		if (dsName.endsWith("DataSource")) {
+
+			// see if setting the state is carried over to any future connection from the
+			// data source object.
+			try {
+				conn.setReadOnly(true);
+			} catch (SQLException sqle) {
+				// cannot set read-only in an active transaction, & sometimes
+				// connections are active at this point.
+			}
+		}
+	}
+
+	protected static void checkStatementS(Connection conn, Statement s) throws SQLException {
+
+		Connection c1 = s.getConnection();
+		if (c1 != conn)
+			System.out.println("FAIL incorrect connection object returned for Statement.getConnection()");
+
+		s.addBatch("insert into y values 1");
+		s.addBatch("insert into y values 2,3");
+		int[] states = s.executeBatch();
+		if (states[0] != 1)
+			System.out.println("FAIL invalid update count for first batch statement");
+		if (states[1] != 2)
+			System.out.println("FAIL invalid update count for second batch statement");
+
+		s.close();
+	}
+	protected void checkStatement(Connection conn, Statement s) throws SQLException {
+
+		Connection c1 = s.getConnection();
+		if (c1 != conn)
+			System.out.println("FAIL incorrect connection object returned for Statement.getConnection()");
+
+		s.addBatch("insert into y values 1");
+		s.addBatch("insert into y values 2,3");
+		int[] states = s.executeBatch();
+		if (states[0] != 1)
+			System.out.println("FAIL invalid update count for first batch statement");
+		if (states[1] != 2)
+			System.out.println("FAIL invalid update count for second batch statement");
+
+		s.close();
+	}
+
+	private static void testDSRequestAuthentication() throws SQLException {
+
+		EmbeddedDataSource ds = new EmbeddedDataSource();
+
+		System.out.println("DataSource - EMPTY");
+		dsConnectionRequests(ds);
+
+		System.out.println("DataSource - connectionAttributes=databaseName=wombat");
+		ds.setConnectionAttributes("databaseName=wombat");
+		dsConnectionRequests(ds);
+		ds.setConnectionAttributes(null);
+
+		System.out.println("DataSource - attributesAsPassword=true");
+		ds.setAttributesAsPassword(true);
+		dsConnectionRequests(ds);
+		ds.setAttributesAsPassword(false);
+
+		System.out.println("DataSource - attributesAsPassword=true, connectionAttributes=databaseName=kangaroo");
+		ds.setAttributesAsPassword(true);
+		ds.setConnectionAttributes("databaseName=kangaroo");
+		dsConnectionRequests(ds);
+		ds.setAttributesAsPassword(false);
+		ds.setConnectionAttributes(null);
+
+		System.out.println("Enable Authentication");
+		ds.setDatabaseName("wombat");
+		Connection cadmin = ds.getConnection();
+		CallableStatement cs = cadmin.prepareCall("CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?, ?)");
+		cs.setString(1, "derby.user.fred");
+		cs.setString(2, "wilma");
+		cs.execute();
+
+		cs.setString(1, "derby.authentication.provider");
+		cs.setString(2, "BUILTIN");
+		cs.execute();
+
+		cs.setString(1, "derby.connection.requireAuthentication");
+		cs.setString(2, "true");
+		cs.execute();
+
+		cs.close();
+
+		cadmin.close();
+
+		ds.setShutdownDatabase("shutdown");
+		try {
+			ds.getConnection();
+		} catch (SQLException sqle) {
+			System.out.println(sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+
+		ds.setDatabaseName(null);
+		ds.setShutdownDatabase(null);
+
+		System.out.println("AUTHENTICATION NOW ENABLED");
+
+		System.out.println("DataSource - attributesAsPassword=true");
+		ds.setAttributesAsPassword(true);
+		dsConnectionRequests(ds);
+		ds.setAttributesAsPassword(false);
+
+		// ensure the DS property password is not treated as a set of attributes.
+		System.out.println("DataSource - attributesAsPassword=true, user=fred, password=databaseName=wombat;password=wilma");
+		ds.setAttributesAsPassword(true);
+		ds.setUser("fred");
+		ds.setPassword("databaseName=wombat;password=wilma");
+		dsConnectionRequests(ds);
+		ds.setAttributesAsPassword(false);
+		ds.setUser(null);
+		ds.setPassword(null);
+		ds = null;
+
+		// now with ConnectionPoolDataSource
+		EmbeddedConnectionPoolDataSource cpds = new EmbeddedConnectionPoolDataSource();
+		System.out.println("ConnectionPoolDataSource - EMPTY");
+		dsConnectionRequests((ConnectionPoolDataSource)cpds);
+
+		System.out.println("ConnectionPoolDataSource - connectionAttributes=databaseName=wombat");
+		cpds.setConnectionAttributes("databaseName=wombat");
+		dsConnectionRequests((ConnectionPoolDataSource)cpds);
+		cpds.setConnectionAttributes(null);
+
+		System.out.println("ConnectionPoolDataSource - attributesAsPassword=true");
+		cpds.setAttributesAsPassword(true);
+		dsConnectionRequests((ConnectionPoolDataSource)cpds);
+		cpds.setAttributesAsPassword(false);
+		
+		// ensure the DS property password is not treated as a set of attributes.
+		System.out.println("ConnectionPoolDataSource - attributesAsPassword=true, user=fred, password=databaseName=wombat;password=wilma");
+		cpds.setAttributesAsPassword(true);
+		cpds.setUser("fred");
+		cpds.setPassword("databaseName=wombat;password=wilma");
+		dsConnectionRequests((ConnectionPoolDataSource)cpds);
+		cpds.setAttributesAsPassword(false);
+		cpds.setUser(null);
+		cpds.setPassword(null);
+		cpds = null;
+
+		// now with XADataSource
+		EmbeddedXADataSource xads = new EmbeddedXADataSource();
+		System.out.println("XADataSource - EMPTY");
+		dsConnectionRequests((XADataSource) xads);
+
+		System.out.println("XADataSource - databaseName=wombat");
+		xads.setDatabaseName("wombat");
+		dsConnectionRequests((XADataSource) xads);
+		xads.setDatabaseName(null);
+
+		System.out.println("XADataSource - connectionAttributes=databaseName=wombat");
+		xads.setConnectionAttributes("databaseName=wombat");
+		dsConnectionRequests((XADataSource) xads);
+		xads.setConnectionAttributes(null);
+
+		System.out.println("XADataSource - attributesAsPassword=true");
+		xads.setAttributesAsPassword(true);
+		dsConnectionRequests((XADataSource) xads);
+		xads.setAttributesAsPassword(false);
+
+		System.out.println("XADataSource - databaseName=wombat, attributesAsPassword=true");
+		xads.setDatabaseName("wombat");
+		xads.setAttributesAsPassword(true);
+		dsConnectionRequests((XADataSource) xads);
+		xads.setAttributesAsPassword(false);
+		xads.setDatabaseName(null);
+	}
+
+	private static void dsConnectionRequests(DataSource ds) {
+		try {
+			Connection c1 = ds.getConnection();
+			System.out.println("  getConnection() - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection() - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+
+		try {
+			Connection c1 = ds.getConnection(null, null);
+			System.out.println("  getConnection(null, null) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(null, null) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection("fred", null);
+			System.out.println("  getConnection(fred, null) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(fred, null) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection("fred", "wilma");
+			System.out.println("  getConnection(fred, wilma) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(fred, wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection(null, "wilma");
+			System.out.println("  getConnection(null, wilma) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(null, wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection(null, "databaseName=wombat");
+			System.out.println("  getConnection(null, databaseName=wombat) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(null, databaseName=wombat) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection("fred", "databaseName=wombat");
+			System.out.println("  getConnection(fred, databaseName=wombat) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(fred, databaseName=wombat) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection("fred", "databaseName=wombat;password=wilma");
+			System.out.println("  getConnection(fred, databaseName=wombat;password=wilma) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(fred, databaseName=wombat;password=wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			Connection c1 = ds.getConnection("fred", "databaseName=wombat;password=betty");
+			System.out.println("  getConnection(fred, databaseName=wombat;password=betty) - OK");
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getConnection(fred, databaseName=wombat;password=betty) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+	}
+	private static void dsConnectionRequests(ConnectionPoolDataSource ds) {
+		try {
+			PooledConnection pc = ds.getPooledConnection();
+			System.out.println("  getPooledConnection() - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection() - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+
+		try {
+			PooledConnection pc = ds.getPooledConnection(null, null);
+			System.out.println("  getPooledConnection(null, null) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(null, null) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection("fred", null);
+			System.out.println("  getPooledConnection(fred, null) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(fred, null) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection("fred", "wilma");
+			System.out.println("  getPooledConnection(fred, wilma) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(fred, wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection(null, "wilma");
+			System.out.println("  getPooledConnection(null, wilma) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(null, wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection(null, "databaseName=wombat");
+			System.out.println("  getPooledConnection(null, databaseName=wombat) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(null, databaseName=wombat) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection("fred", "databaseName=wombat");
+			System.out.println("  getPooledConnection(fred, databaseName=wombat) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(fred, databaseName=wombat) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection("fred", "databaseName=wombat;password=wilma");
+			System.out.println("  getPooledConnection(fred, databaseName=wombat;password=wilma) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(fred, databaseName=wombat;password=wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			PooledConnection pc = ds.getPooledConnection("fred", "databaseName=wombat;password=betty");
+			System.out.println("  getPooledConnection(fred, databaseName=wombat;password=betty) - OK");
+			Connection c1 = pc.getConnection();
+			c1.close();
+			pc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getPooledConnection(fred, databaseName=wombat;password=betty) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+	}
+	private static void dsConnectionRequests(XADataSource ds) {
+		try {
+			XAConnection xc = ds.getXAConnection();
+			System.out.println("  getXAConnection() - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection() - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+
+		try {
+			XAConnection xc = ds.getXAConnection(null, null);
+			System.out.println("  getXAConnection(null, null) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(null, null) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection("fred", null);
+			System.out.println("  getXAConnection(fred, null) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(fred, null) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection("fred", "wilma");
+			System.out.println("  getXAConnection(fred, wilma) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(fred, wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection(null, "wilma");
+			System.out.println("  getXAConnection(null, wilma) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(null, wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection(null, "databaseName=wombat");
+			System.out.println("  getXAConnection(null, databaseName=wombat) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(null, databaseName=wombat) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection("fred", "databaseName=wombat");
+			System.out.println("  getXAConnection(fred, databaseName=wombat) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(fred, databaseName=wombat) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection("fred", "databaseName=wombat;password=wilma");
+			System.out.println("  getXAConnection(fred, databaseName=wombat;password=wilma) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(fred, databaseName=wombat;password=wilma) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+		try {
+			XAConnection xc = ds.getXAConnection("fred", "databaseName=wombat;password=betty");
+			System.out.println("  getXAConnection(fred, databaseName=wombat;password=betty) - OK");
+			Connection c1 = xc.getConnection();
+			c1.close();
+			xc.close();
+		} catch (SQLException sqle) {
+			System.out.println("  getXAConnection(fred, databaseName=wombat;password=betty) - " + sqle.getSQLState() + ":" + sqle.getMessage() );
+		}
+	}
+
+	protected Xid getXid(int xid, byte b1, byte b2) {
+		return new cdsXid(xid, b1, b2);
+	}
+
+	public static String translateIso(int iso)
+	{
+		switch(iso)
+		{
+		case Connection.TRANSACTION_READ_COMMITTED: return "READ_COMMITTED";
+		case Connection.TRANSACTION_SERIALIZABLE: return "SERIALIZABLE";
+		case Connection.TRANSACTION_REPEATABLE_READ: return "REPEATABLE_READ";
+		case Connection.TRANSACTION_READ_UNCOMMITTED: return "READ_UNCOMMITTED";
+		}
+		return "unknown";
+	}
+
+
+}
+class cdsXid implements Xid, Serializable
+{
+  private static final long serialVersionUID = 64467338100036L;
+
+	private final int format_id;
+	private byte[] global_id;
+	private byte[] branch_id;
+
+
+	cdsXid(int xid, byte b1, byte b2)
+	{
+		format_id = xid;
+		global_id = new byte[Xid.MAXGTRIDSIZE];
+		branch_id = new byte[Xid.MAXBQUALSIZE];
+
+		for (int i = 0; i < global_id.length; i++) {
+			global_id[i] = b1;
+		}
+
+		for (int i = 0; i < branch_id.length; i++) {
+			branch_id[i] = b2;
+		}
+	}
+
+    /**
+     * Obtain the format id part of the Xid.
+     * <p>
+     *
+     * @return Format identifier. O means the OSI CCR format.
+     **/
+    public int getFormatId()
+    {
+        return(format_id);
+    }
+
+    /**
+     * Obtain the global transaction identifier part of XID as an array of 
+     * bytes.
+     * <p>
+     *
+	 * @return A byte array containing the global transaction identifier.
+     **/
+    public byte[] getGlobalTransactionId()
+    {
+        return(global_id);
+    }
+
+    /**
+     * Obtain the transaction branch qualifier part of the Xid in a byte array.
+     * <p>
+     *
+	 * @return A byte array containing the branch qualifier of the transaction.
+     **/
+    public byte[] getBranchQualifier()
+    {
+        return(branch_id);
+    }
+
+
+}
+
+class EventCatcher implements ConnectionEventListener
+{
+	private final int catcher;
+
+	EventCatcher(int which) {
+		catcher=which;
+	}
+
+	// ConnectionEventListener methods
+	public void connectionClosed(ConnectionEvent event)
+	{
+		System.out.print("EVENT("+catcher+"):connectionClosed");
+		SQLException sqle = event.getSQLException();
+		if (sqle != null)
+			System.out.print(" SQLSTATE=" + sqle.getSQLState());
+		System.out.println("");
+	}
+
+	public void connectionErrorOccurred(ConnectionEvent event)
+	{
+		System.out.print("EVENT("+catcher+"):connectionErrorOccurred");
+		SQLException sqle = event.getSQLException();
+		if (sqle != null)
+			System.out.print(" SQLSTATE=" + sqle.getSQLState());
+		System.out.println("");
+
+	}
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDataSource30.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,392 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource30
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import org.apache.derby.jdbc.EmbeddedDataSource;
+import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource;
+import org.apache.derby.jdbc.EmbeddedXADataSource;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.PreparedStatement;
+import java.sql.CallableStatement;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.DriverManager;
+import java.sql.Savepoint;
+import java.sql.ParameterMetaData;
+
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+import javax.sql.XAConnection;
+import javax.sql.ConnectionPoolDataSource;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+import javax.sql.ConnectionEventListener;
+import javax.sql.ConnectionEvent;
+import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derby.tools.ij;
+
+import java.io.*;
+import java.util.Hashtable;
+
+import javax.naming.*;
+import javax.naming.directory.*;
+
+public class checkDataSource30 extends checkDataSource
+{ 
+
+	public static void main(String[] args) throws Exception {
+
+		checkDataSource30 tester = new checkDataSource30();
+
+
+		tester.runTest(args);
+		tester.checkXAHoldability();
+		System.out.println("Completed checkDataSource30");
+
+	}
+
+
+	public checkDataSource30() throws Exception {
+	}
+
+	public void checkConnection(String dsName, Connection conn) throws SQLException {
+
+		System.out.println("Running JDBC 3.0 connection checks on " + dsName);
+
+		
+		System.out.println("  holdability     " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+		// check it's a 3.0 connection object
+		try {
+			conn.releaseSavepoint(conn.setSavepoint());
+			System.out.println("JDBC 3.0 savepoint OK");
+		} catch (SQLException sqle) {
+			// we expect savepoints exceptions because either
+			// it's a global transaction, or it's in auto commit mode.
+			System.out.println("JDBC 3.0 savepoint " + sqle.toString());
+		}
+
+
+		super.checkConnection(dsName, conn);
+	}
+
+	protected void checkConnectionPreClose(String dsName, Connection conn) throws SQLException {
+
+		conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
+
+		super.checkConnectionPreClose(dsName, conn);
+
+	}
+	protected void setHoldability(Connection conn, boolean hold) throws SQLException {
+
+		conn.setHoldability(hold ? ResultSet.HOLD_CURSORS_OVER_COMMIT : ResultSet.CLOSE_CURSORS_AT_COMMIT);
+	}
+	protected void getHoldability(Connection conn) throws SQLException {
+
+		System.out.println("  holdability     " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+	}
+
+	protected Statement internalCreateFloatStatementForStateChecking(Connection conn) throws SQLException {
+		return conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+	}
+	protected PreparedStatement internalCreateFloatStatementForStateChecking(Connection conn, String sql) throws SQLException {
+		return conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+	}
+	protected CallableStatement internalCreateFloatCallForStateChecking(Connection conn, String sql) throws SQLException {
+		return conn.prepareCall(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+	}
+
+
+	protected void showStatementState(String when, Statement s) throws SQLException {
+		super.showStatementState(when, s);
+		System.out.println("  getResultSetHoldability() " + rsHoldability(s.getResultSetHoldability()));
+		if (s instanceof PreparedStatement) {
+			PreparedStatement ps = (PreparedStatement) s;
+			ParameterMetaData psmd = ps.getParameterMetaData();
+			System.out.println("  Parameter Count " + psmd.getParameterCount());
+			for (int i = 1; i <= psmd.getParameterCount(); i++) {
+				System.out.println("    " + i + " type " + psmd.getParameterType(i));
+			}
+		}
+	}
+
+	protected void showXAException(String tag, XAException xae) {
+
+		super.showXAException(tag, xae);
+		Throwable t = xae.getCause();
+		if (t instanceof SQLException)
+			JDBCDisplayUtil.ShowSQLException(System.out, (SQLException) t);
+	}
+
+
+	static String rsHoldability(int type) {
+		switch (type) {
+		case ResultSet.HOLD_CURSORS_OVER_COMMIT :
+			return "HOLD_CURSORS_OVER_COMMIT ";
+		case ResultSet.CLOSE_CURSORS_AT_COMMIT :
+			return "CLOSE_CURSORS_AT_COMMIT ";
+		default:
+			return "?? HOLDABILITY UNKNOWN ??";
+
+		}
+	}
+
+	private void checkXAHoldability() {
+		System.out.println("START XA HOLDABILITY TEST");
+		try {
+			EmbeddedXADataSource dscsx = new EmbeddedXADataSource();
+			dscsx.setDatabaseName("wombat");
+
+			XAConnection xac = dscsx.getXAConnection("fred", "wilma");
+			XAResource xr = xac.getXAResource();
+			Xid xid = getXid(25, (byte) 21, (byte) 01);
+			Connection conn1 = xac.getConnection();
+			System.out.println("By default, autocommit is " + conn1.getAutoCommit() + " for a connection");
+			System.out.println("Default holdability for a connection is HOLD_CURSORS_OVER_COMMIT");
+			System.out.println("CONNECTION(not in xa transaction yet) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			//start a global transaction and default holdability and autocommit will be switched to match Derby XA restrictions
+			xr.start(xid, XAResource.TMNOFLAGS);
+			System.out.println("Notice that autocommit now is " + conn1.getAutoCommit() + " for connection because it is part of the global transaction");
+			System.out.println("Notice that connection's holdability at this point is CLOSE_CURSORS_AT_COMMIT because it is part of the global transaction");
+			System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			xr.end(xid, XAResource.TMSUCCESS);
+			conn1.commit();
+			conn1.close();
+
+			xid = getXid(27, (byte) 21, (byte) 01);
+			xr.start(xid, XAResource.TMNOFLAGS);
+			conn1 = xac.getConnection();
+			System.out.println("This is a bug. Connection's holdability should have been CLOSE_CURSORS_AT_COMMIT since it is in the global transaction");
+			System.out.println("Have reported this on Derby dev-list");
+			System.out.println("CONNECTION(in xa transaction) HOLDABILITY " + (conn1.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("Autocommit on Connection inside global transaction has been set correctly to " + conn1.getAutoCommit());
+			xr.end(xid, XAResource.TMSUCCESS);
+			conn1.rollback();
+
+			Connection conn = xac.getConnection();
+			conn.setAutoCommit(false);
+			conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
+			System.out.println("CONNECTION(non-xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+			Statement s = conn.createStatement();
+			System.out.println("STATEMENT HOLDABILITY " + (s.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+
+			s.executeUpdate("create table hold_30 (id int not null primary key, b char(30))");
+			s.executeUpdate("insert into hold_30 values (1,'init2'), (2, 'init3'), (3,'init3')");
+			s.executeUpdate("insert into hold_30 values (4,'init4'), (5, 'init5'), (6,'init6')");
+			s.executeUpdate("insert into hold_30 values (7,'init7'), (8, 'init8'), (9,'init9')");
+
+			System.out.println("STATEMENT HOLDABILITY " + (s.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+			Statement sh = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+			PreparedStatement psh = conn.prepareStatement("select id from hold_30 for update",
+				ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+			CallableStatement csh = conn.prepareCall("select id from hold_30 for update",
+				ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+
+			System.out.println("STATEMENT HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("PREPARED STATEMENT HOLDABILITY " + (psh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("CALLABLE STATEMENT HOLDABILITY " + (csh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+			ResultSet rsh = sh.executeQuery("select id from hold_30 for update");
+			rsh.next(); System.out.println("H@1 id " + rsh.getInt(1));
+			rsh.next(); System.out.println("H@2 id " + rsh.getInt(1));
+			conn.commit();
+			rsh.next(); System.out.println("H@3 id " + rsh.getInt(1));
+			conn.commit();
+
+
+			xid = getXid(23, (byte) 21, (byte) 01);
+			xr.start(xid, XAResource.TMNOFLAGS);
+			Statement stmtInsideGlobalTransaction = conn.createStatement();
+			PreparedStatement prepstmtInsideGlobalTransaction = conn.prepareStatement("select id from hold_30");
+			CallableStatement callablestmtInsideGlobalTransaction = conn.prepareCall("select id from hold_30");
+
+			System.out.println("CONNECTION(xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with holdability false, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY " + (s.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY " + (stmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("PREPAREDSTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY " + (prepstmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("CALLABLESTATEMENT(this one was created with default holdability inside this global transaction. Check it's holdability) HOLDABILITY " + (callablestmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+			ResultSet rsx = s.executeQuery("select id from hold_30 for update");
+			rsx.next(); System.out.println("X@1 id " + rsx.getInt(1));
+			rsx.next(); System.out.println("X@2 id " + rsx.getInt(1));
+			xr.end(xid, XAResource.TMSUCCESS);
+
+			// result set should not be useable, since it is part of a detached
+			// XAConnection
+			try {
+				rsx.next(); System.out.println("FAIL - rsx's connection not active id " + rsx.getInt(1));
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException " + sqle.getMessage());
+			}
+
+			// result set should not be useable, it should have been closed by the xa start.
+			try {
+				rsh.next(); System.out.println("FAIL - rsh's should be closed " + rsx.getInt(1));
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException " + sqle.getMessage());
+			}
+
+			System.out.println("resume XA transaction and keep using rs");
+			xr.start(xid, XAResource.TMJOIN);
+			Statement stmtAfterGlobalTransactionResume = conn.createStatement();
+			PreparedStatement prepstmtAfterGlobalTransactionResume = conn.prepareStatement("select id from hold_30");
+			CallableStatement callablestmtAfterGlobalTransactionResume = conn.prepareCall("select id from hold_30");
+
+			System.out.println("Check holdability of various jdbc objects after resuming XA transaction");
+			System.out.println("CONNECTION(xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with holdability false, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY " + (s.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with holdability true, outside the global transaction. Check it's holdability inside global transaction) HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY " + (stmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("PREPAREDSTATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY " + (prepstmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("CALLABLESTATEMENT(this one was created with default holdability inside the global transaction when it was first started. Check it's holdability) HOLDABILITY " + (callablestmtInsideGlobalTransaction.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("STATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (stmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("PREPAREDSTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (prepstmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			System.out.println("CALLABLESTATEMENT(this one was created with default holdability after the global transaction was resumed. Check it's holdability) HOLDABILITY " + (callablestmtAfterGlobalTransactionResume.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			rsx.next(); System.out.println("X@3 id " + rsx.getInt(1));
+			xr.end(xid, XAResource.TMSUCCESS);
+
+
+			if (xr.prepare(xid) != XAResource.XA_RDONLY)
+				xr.commit(xid, false);
+
+			// try again once the xa transaction has been committed.			
+			try {
+				rsx.next(); System.out.println("FAIL - rsx's connection not active id (B)" + rsx.getInt(1));
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException " + sqle.getMessage());
+			}
+
+			try {
+				rsh.next(); System.out.println("FAIL - rsh's should be closed (B) " + rsx.getInt(1));
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException " + sqle.getMessage());
+			}
+
+			System.out.println("Set connection to hold ");
+			conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
+			System.out.println("CONNECTION(held) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+			xid = getXid(24, (byte) 21, (byte) 01);
+			xr.start(xid, XAResource.TMNOFLAGS);
+			System.out.println("CONNECTION(xa) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			try {
+				conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
+				System.out.println("FAIL allowed to set hold mode in xa transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException(setHoldability) " + sqle.getMessage());
+			}
+
+			// try to create a statement with held attributes
+			try {
+				Statement shxa = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+				System.out.println("FAIL opened statement with hold cursor attribute in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (Statement hold) " + sqle.getMessage());
+			}
+			try {
+				Statement shxa = conn.prepareStatement("select id from hold_30",
+					ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+				System.out.println("FAIL opened statement with hold cursor attribute in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (PreparedStatement hold) " + sqle.getMessage());
+			}
+			try {
+				Statement shxa = conn.prepareCall("CALL XXX.TTT()",
+					ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);
+				System.out.println("FAIL opened statement with hold cursor attribute in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (CallableStatement hold) " + sqle.getMessage());
+			}
+
+			// check we cannot use a holdable statement set up in local mode.
+			System.out.println("STATEMENT HOLDABILITY " + (sh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			try {
+				sh.executeQuery("select id from hold_30");
+				System.out.println("FAIL used held statement in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (local Statement hold) " + sqle.getMessage());
+			}
+			try {
+				sh.execute("select id from hold_30");
+				System.out.println("FAIL used held statement in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (local Statement hold) " + sqle.getMessage());
+			}
+			System.out.println("PREPARED STATEMENT HOLDABILITY " + (psh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			try {
+				psh.executeQuery();
+				System.out.println("FAIL used held prepared statement in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (local PreparedStatement hold) " + sqle.getMessage());
+			}
+			try {
+				psh.execute();
+				System.out.println("FAIL used held prepared statement in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (local PreparedStatement hold) " + sqle.getMessage());
+			}
+
+			System.out.println("CALLABLE STATEMENT HOLDABILITY " + (csh.getResultSetHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+			try {
+				csh.executeQuery();
+				System.out.println("FAIL used held callable statement in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (local CallableStatement hold) " + sqle.getMessage());
+			}
+			try {
+				csh.execute();
+				System.out.println("FAIL used held callable statement in global transaction");
+			} catch (SQLException sqle) {
+				System.out.println("Expected SQLException (local CallableStatement hold) " + sqle.getMessage());
+			}
+
+			// but an update works
+			sh.executeUpdate("insert into hold_30 values(10, 'init10')");
+
+			xr.end(xid, XAResource.TMSUCCESS);
+	
+			System.out.println("CONNECTION(held) HOLDABILITY " + (conn.getHoldability() == ResultSet.HOLD_CURSORS_OVER_COMMIT));
+
+			conn.close();
+			System.out.println("PASS XA HOLDABILITY TEST");
+
+		} catch (XAException xae) {
+			System.out.println("XAException error code " + xae.errorCode);
+			xae.printStackTrace(System.out);
+			Throwable t = xae.getCause();
+			if (t instanceof SQLException)
+				JDBCDisplayUtil.ShowSQLException(System.out, (SQLException) t);
+
+		} catch (SQLException sqle) {
+			JDBCDisplayUtil.ShowSQLException(System.out, sqle);
+		} catch (Throwable t) {
+			t.printStackTrace(System.out);
+		}
+		System.out.flush();
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/connectionJdbc20.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,280 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.connectionJdbc20
+
+   Copyright 2000, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.sql.PreparedStatement;
+import java.sql.CallableStatement;
+import java.sql.DatabaseMetaData;
+import java.io.*;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ *This Program Test getConnection()/getStatement().
+ * @author - suresht
+ */
+
+public class connectionJdbc20{ 
+   
+	static private boolean isDerbyNet = false;
+
+	public static void main(String[] args) {
+		Connection conn, connreturn;
+		Statement stmt, stmtreturn;
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+
+		System.out.println("Test connection20 starting");
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			 ij.getPropertyArg(args);
+			 conn = ij.startJBMS();
+			 stmt = conn.createStatement();
+            //create a table, insert a row, do a select from the table,
+			 stmt.execute("create table tab1("+
+                                           "c1 char(100) for bit data,"+
+                                           "c2 varchar(100) for bit data," +
+                                           "c3 long varchar for bit data,"+
+                                           "c4 char(100),"+ 
+                                           "c5 varchar(100),"+
+                                           "c6 long varchar)");
+
+            connreturn = stmt.getConnection();
+            if (conn.equals(connreturn))
+                System.out.println("Got Same Connection Object");
+            else
+                System.out.println("Got Different Connection Object");
+           
+            // load some data into this table ..
+            load_data(connreturn);
+            
+			// read the data   of each type with all the possible functions
+			ResultSet rs = stmt.executeQuery("select * from tab1");
+            int loop = 0;
+            while(loop < 2 )
+            {
+                while (rs.next())
+                {
+                    for(int i=1 ; i < 7 ; i++)
+                    {
+                        get_using_object(rs, i);
+                        get_using_string(rs, i);
+						get_using_ascii_stream(rs, i);
+                        if(i < 4 ) // only c1 , c2, c3
+                        {
+                            get_using_binary_stream(rs, i);
+                            get_using_bytes(rs, i);
+                        }
+                    } 
+                }
+                // get the statment back from the result set
+                stmtreturn = rs.getStatement();
+                if (stmt.equals(stmtreturn))
+                    System.out.println("Got Same Statement Object");
+                else
+                    System.out.println("Got Different Statement Object");
+                
+                rs.close();
+			    rs = stmt.executeQuery("select * from tab1");
+                loop++;
+            }
+
+			stmt.close();
+
+            // Try to get the connection object thro database meta data
+            DatabaseMetaData dbmeta = conn.getMetaData();
+
+			rs = dbmeta.getTypeInfo();
+            while (rs.next())
+            {
+               System.out.println(rs.getString(1)); 
+            }
+            // try to get a statemet from a meta data result set
+            stmt = rs.getStatement(); 
+
+            // Try to get the Connection back from a Metadata
+            System.out.println("Try to Get the connection back from metadata");
+            connreturn = dbmeta.getConnection();
+            if (conn.equals(connreturn))
+                System.out.println("Got Same Connection Object");
+            else
+                System.out.println("Got Different Connection Object");
+
+             
+            // Try to get the connection thru callable statement
+            CallableStatement  cs = conn.prepareCall("select * from tab1");
+            System.out.println(" Try to get the connection back from a callable stmt");
+            connreturn = cs.getConnection();
+            if (conn.equals(connreturn))
+                System.out.println("Got Same Connection Object");
+            else
+                System.out.println("Got Different Connection Object");
+
+            cs.close();
+			conn.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test getConnection  finished");
+    }
+
+
+    static private void load_data(Connection conn) throws Exception{
+        PreparedStatement pstmt = null;
+
+        try{
+            pstmt = conn.prepareStatement(
+                     "insert into tab1 values(?,?,?,?,?,?)");
+            String c1_value="C1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+            String c2_value="C2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+            String c3_value="C3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+            String c4_value="C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+            String c5_value="C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+            String c6_value="C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+
+            pstmt.setBytes(1, c1_value.getBytes("US-ASCII"));
+            pstmt.setBytes(2, c2_value.getBytes("US-ASCII"));
+            pstmt.setBytes(3, c3_value.getBytes("US-ASCII"));
+            pstmt.setString(4, c4_value);
+            pstmt.setString(5, c5_value);
+            pstmt.setString(6, c6_value);
+            pstmt.execute();
+
+            // get the connection back thru preapred statement
+            System.out.println("Try to get connection using preaparedstatement");
+            Connection connreturn = pstmt.getConnection();
+            if (conn.equals(connreturn))
+                System.out.println("Got Same Connection Object");
+            else
+                System.out.println("Got Different Connection Object");
+
+        }catch(SQLException e){
+             dumpSQLExceptions(e);
+             e.printStackTrace();
+        }catch(Throwable e ){
+             System.out.println("Fail -- unexpected exception ");
+             e.printStackTrace();
+        }finally{
+             pstmt.close();
+        }
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+		}
+	}
+
+	static private void dumpExpectedSQLExceptions (SQLException se) {
+		System.out.println("PASS -- expected exception");
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+        }
+    }
+
+    static private int printbytearray(byte [] a , int len, int count){
+
+		for (int i =0 ; i < len; i++, count++) {
+
+			System.out.print("x" + Integer.toHexString(a[i]));
+
+			if ((i > 0) && ((i % 20) == 0))
+				System.out.println("");
+		}
+		return count;
+    }
+
+    static void get_using_object(ResultSet rs, int col_no) throws Exception{
+		System.out.println("getObject(" + col_no + ")");
+        Object cobj = rs.getObject(col_no);
+        if (cobj instanceof byte[]){
+            byte[] bytearray = (byte[]) cobj;
+			System.out.println("  as byte[] length " + bytearray.length);
+            printbytearray(bytearray, bytearray.length, 0);
+			System.out.println("");
+        }else {
+			System.out.println("  as String");
+            System.out.println(cobj.toString());
+		}
+    }
+
+    static void get_using_bytes(ResultSet rs, int col_no) throws Exception{
+		System.out.println("getBytes(" + col_no + ")");
+       byte[] bytearray = (byte[]) rs.getBytes(col_no);
+       printbytearray(bytearray, bytearray.length, 0);
+		System.out.println("");
+    }
+
+    static void get_using_string(ResultSet rs, int col_no) throws Exception{
+		String s = rs.getString(col_no);
+		System.out.println("getString(" + col_no + ") length " + s.length());
+        System.out.println(s);
+    }
+
+    static void get_using_ascii_stream(ResultSet rs, int col_no) throws Exception{
+ 		System.out.println("getAsciiStream(" + col_no + ")");
+		int no_bytes_read = 0;
+        InputStream rsbin = rs.getAsciiStream(col_no);
+        byte [] bytearray = new byte[200];
+		int count = 0;
+        while((no_bytes_read=rsbin.read(bytearray)) != -1)
+        {
+			count = printbytearray(bytearray, no_bytes_read, count);
+        }
+		System.out.println("");
+
+    }
+
+    static void get_using_binary_stream(ResultSet rs, int col_no) throws Exception{
+ 		System.out.println("getBinaryStream(" + col_no + ")");
+        int no_bytes_read = 0;
+        InputStream rsbin = rs.getBinaryStream(col_no);
+        byte [] bytearray = new byte[200];
+		int count = 0;
+        while((no_bytes_read=rsbin.read(bytearray)) != -1)
+        {
+			count = printbytearray(bytearray, no_bytes_read, count);
+        }
+		System.out.println("");
+    }
+
+}

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant	Tue Jan 11 11:53:57 2005
@@ -1,11 +1,52 @@
+aclob.txt
+batchUpdate_derby.properties
+blobclob4BLOB_app.properties
+blobclob4BLOB_derby.properties
+bestrowidentifier.sql
+bestrowidentifier_app.properties
+dbMetaDataJdbc30_app.properties
+dbMetaDataJdbc30_sed.properties
 default_app.properties
 default_derby.properties
+empty.txt
+getCurConnJdbc20.sql
+littleclob.txt
 metadata_app.properties
 metadata_derby.properties
 metadata_sed.properties
+metadataJdbc20_app.properties
+metadataJdbc20_derby.properties
+metadataJdbc20_sed.properties
+resultsetJdbc30_app.properties
+resultsetJdbc30_sed.properties
+resultsetStream.gif
+resultsetStream_app.properties
+resultsetJdbc30_sed.properties
 savepointJdbc30_app.properties
 savepointJdbc30_derby.properties
+secureUsers.sql
+secureUsers1.sql
+secureUsers1_app.properties
+secureUsers1_derby.properties
+secureUsers1_sed.properties
+secureUsers_app.properties
+secureUsers_derby.properties
+secureUsers_sed.properties
+secureUsersldap.sql
+secureUsersldap_app.properties
+secureUsersldap_derby.properties
+secureUsersldap_sed.properties
+searchclob.txt
+short.txt
 parameterMetaDataJdbc30_app.properties
+users.sql
+users2.sql
+users2_app.properties
+users2_derby.properties
+users2_sed.properties
+users_app.properties
+users_derby.properties
+users_sed.properties
 xaAnotherTest.sql
 xaAnotherTest_app.properties
 xaAnotherTest_derby.properties

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,257 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.dbMetaDataJdbc30
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
+import org.apache.derby.tools.ij;
+
+/**
+ * Test of database meta-data for new methods in jdbc 30. This program simply calls
+ * each of the new meta-data methods in jdbc30, one by one, and prints the results.
+ *
+ * @author mamta
+ */
+
+public class dbMetaDataJdbc30 { 
+
+	public static void main(String[] args) {
+		DatabaseMetaData met;
+		Connection con;
+		Statement  s;
+
+
+		System.out.println("Test dbMetaDataJdbc30 starting");
+    
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+
+			con.setAutoCommit(true); // make sure it is true
+
+			s = con.createStatement();
+
+			met = con.getMetaData();
+
+			System.out.println("JDBC Driver '" + met.getDriverName() +
+							   "', version " + met.getDriverMajorVersion() +
+							   "." + met.getDriverMinorVersion() +
+							   " (" + met.getDriverVersion() + ")");
+
+			System.out.println("The URL is: " + met.getURL());
+
+			System.out.println();
+			System.out.println("supportsSavepoints() : " + met.supportsSavepoints());
+
+			System.out.println();
+			System.out.println("supportsNamedParameters() : " + met.supportsNamedParameters());
+
+			System.out.println();
+			System.out.println("supportsMultipleOpenResults() : " + met.supportsMultipleOpenResults());
+
+			System.out.println();
+			System.out.println("supportsGetGeneratedKeys() : " + met.supportsGetGeneratedKeys());
+
+      System.out.println();
+      System.out.println("supportsResultSetHoldability(HOLD_CURSORS_OVER_COMMIT) : " +
+      met.supportsResultSetHoldability(JDBC30Translation.HOLD_CURSORS_OVER_COMMIT));
+
+			System.out.println();
+			System.out.println("supportsResultSetHoldability(CLOSE_CURSORS_AT_COMMIT) : " +
+        met.supportsResultSetHoldability(JDBC30Translation.CLOSE_CURSORS_AT_COMMIT));
+
+			System.out.println();
+			System.out.println("getJDBCMajorVersion() : " + met.getJDBCMajorVersion());
+
+			System.out.println();
+			System.out.println("getJDBCMinorVersion() : " + met.getJDBCMinorVersion());
+
+			System.out.println();
+			System.out.println("getSQLStateType() : " + met.getSQLStateType());
+
+			System.out.println();
+			System.out.println("getResultSetHoldability() : " + met.getResultSetHoldability());
+
+			System.out.println();
+			System.out.println("getDatabaseMajorVersion() : " + met.getDatabaseMajorVersion());
+
+			System.out.println();
+			System.out.println("getDatabaseMinorVersion() : " + met.getDatabaseMinorVersion());
+
+			System.out.println();
+			System.out.println("supportsStatementPooling() : " + met.supportsStatementPooling());
+
+			System.out.println("getMaxColumnNameLength() = "+met.getMaxColumnNameLength());
+			System.out.println("getMaxCursorNameLength() = "+met.getMaxCursorNameLength());
+			System.out.println("getMaxSchemaNameLength() = "+met.getMaxSchemaNameLength());
+			System.out.println("getMaxProcedureNameLength() = "+met.getMaxProcedureNameLength());
+			System.out.println("getMaxTableNameLength() = "+met.getMaxTableNameLength());
+			System.out.println("getMaxUserNameLength() = "+met.getMaxUserNameLength());
+
+			//following will give not implemented exceptions.
+			// JCC will return an empty result set, so either a
+			// result set with no rows or an exception will pass
+			try {
+			  System.out.println();
+			  System.out.println("getSuperTypes() with null :");
+			  checkEmptyRSOrNotImplemented(met.getSuperTypes(null,null,null),null);
+ 			} catch (SQLException ex) {
+				checkEmptyRSOrNotImplemented(null,ex);
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("getSuperTables() with null :");
+			  checkEmptyRSOrNotImplemented(met.getSuperTables(null,null,null),null);
+ 			} catch (SQLException ex) {
+				checkEmptyRSOrNotImplemented(null,ex);
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("getAttributes() with null :");
+
+ 			  checkEmptyRSOrNotImplemented(met.getAttributes(null, null, null,
+															 null), null);
+ 			} catch (SQLException ex) {
+				checkEmptyRSOrNotImplemented(null,ex);
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("locatorsUpdateCopy(): ");
+			  // JCC doesn't throw exception, Embedded driver does.
+			  System.out.println("Returned: " + met.locatorsUpdateCopy());
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+        
+			s.close();
+
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+
+		System.out.println("Test dbMetaDataJdbc30 finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se.printStackTrace(System.out);
+			se = se.getNextException();
+		}
+	}
+
+	static void dumpRS(ResultSet s) throws SQLException {
+		ResultSetMetaData rsmd = s.getMetaData ();
+
+		// Get the number of columns in the result set
+		int numCols = rsmd.getColumnCount ();
+
+		if (numCols <= 0) {
+			System.out.println("(no columns!)");
+			return;
+		}
+		
+		// Display column headings
+		for (int i=1; i<=numCols; i++) {
+			if (i > 1) System.out.print(",");
+			System.out.print(rsmd.getColumnLabel(i));
+		}
+		System.out.println();
+	
+		// Display data, fetching until end of the result set
+		while (s.next()) {
+			// Loop through each column, getting the
+			// column data and displaying
+			for (int i=1; i<=numCols; i++) {
+				if (i > 1) System.out.print(",");
+				System.out.print(s.getString(i));
+			}
+			System.out.println();
+		}
+		s.close();
+	}
+
+	/**
+	 * JCC returns an empty resultset instead of throwing an exception
+	 * for some methods.
+	 * Checks for either a ResultSet with no rows or a NotImplemented  
+	 * exception.  Usually either the rs or se are null.
+	 *
+	 */
+	static void checkEmptyRSOrNotImplemented(ResultSet rs, SQLException se)
+	{		
+		boolean passed = false;
+
+		try {
+			
+			if (rs != null)
+			{
+				int numrows = 0;
+				while (rs.next())
+					numrows++;
+				// Zero rows is what we want.
+				if (numrows == 0)
+					passed = true;			
+			}
+			else if (se != null)
+			{
+				// Not implemented exception is OK too.
+				String sqlState =se.getSQLState();
+				if (sqlState != null && sqlState.startsWith("0A"))
+				passed = true;
+			}
+		}
+		catch (SQLException e)
+		{
+			System.out.println("Unexpected SQL Exception" + 
+							   e.getMessage());
+			e.printStackTrace();
+		}
+		finally 
+		{
+			if (passed)
+				System.out.println("EXPECTED: Not Implemented Exception or empty  ResultSet");
+			else 
+				System.out.println("FAIL:  Should have gotten Not Implemented Exception or empty ResultSet");
+		}
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,5 @@
+# caching helps out metadata test (reduced from 5 to 3 minutes)
+usedefaults=true
+runwithjdk13=false
+runwithibm13=false
+runwithj9=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/dbMetaDataJdbc30_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,9 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+substitute=version [0-9].[0-9]..[0-9].[0-9].[0-9][0-9]?.$;version (EXPECTED VERSION),version [0-9].[0-9]..[0-9].[0-9].[0-9][0-9]? Test Build.$;version (EXPECTED VERSION)

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/empty.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/empty.txt?view=auto&rev=124918
==============================================================================

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/getCurConnJdbc20.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/getCurConnJdbc20.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/getCurConnJdbc20.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,20 @@
+-- test getCurConnJdbc20
+-- this test will get run under jdk12 only. If run under jdk11x, will get an exception like
+-- following for call to newToJdbc20Method
+-- ERROR 38000: The exception 'java.lang.NoSuchMethodError: java.sql.Connection: method 
+-- createStatement(II)Ljava/sql/Statement; not found' was thrown while evaluating an expression.
+
+
+-- method alias and table used later
+create procedure newToJdbc20Method() PARAMETER STYLE JAVA LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Jdbc20Test.newToJdbc20Method';
+create table T (a int NOT NULL primary key);
+insert into T values (1);
+
+-- now lets try a variety of errors
+call newToJdbc20Method();
+
+------------------------------------------------------------
+-- drop the table
+drop table T;
+
+drop procedure newToJdbc20Method;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/littleclob.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/littleclob.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/littleclob.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,100 @@
+Beginning-this-is-itwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwposition-69-end-of-the-first-l
+ine-we-are-now-on-the-second-onewwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwThis-is-position-204wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwI-am-hiding-here-at-position-5910-in-this-little-clobwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwPosition-9907-behold-the-end-of-the-clob-is-nighwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/maxfieldsize.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,318 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.maxfieldsize
+
+   Copyright 2000, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.sql.PreparedStatement;
+import java.io.*;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ *This Program Test SetMaxFieldsize()/getMaxFieldsize().
+ *and the getXXX calls that are affected.
+ * @author - suresht
+ */
+
+public class maxfieldsize { 
+    
+   
+    public static ResultSet rs;
+
+	static final int START_SECOND_HALF = 5;
+	static final int NUM_EXECUTIONS = 2 * START_SECOND_HALF;
+
+    static final String c1_value="C1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+    static final String c2_value="C2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+    static final String c3_value="C3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+    static final String c4_value="C4XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+    static final String c5_value="C5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+    static final String c6_value="C6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+	
+	static private boolean isDerbyNet = false;
+   
+	public static void main(String[] args) {
+		Connection conn;
+		Statement stmt;
+
+		System.out.println("Test MaxFieldSize  starting");
+
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+		
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			 ij.getPropertyArg(args);
+			 conn = ij.startJBMS();
+			 stmt = conn.createStatement();
+            //create a table, insert a row, do a select from the table,
+			 stmt.execute("create table tab1("+
+                                           "c1 char(100) for bit data,"+
+                                           "c2 varchar(100) for bit data," +
+                                           "c3 long varchar for bit data,"+
+                                           "c4 char(100),"+ 
+                                           "c5 varchar(100),"+
+                                           "c6 long varchar)");
+            // load some data into this table ..
+            load_data(conn);
+
+            // read the data   of each type with all the possible functions
+            int loop = 0;
+            while (loop < NUM_EXECUTIONS )
+            {
+				if (loop == START_SECOND_HALF)
+				{
+					stmt.setMaxFieldSize(24);
+				}
+
+				System.out.println("Iteration #: " + loop);
+	            System.out.println("Max Field Size = "  + stmt.getMaxFieldSize());
+				rs = stmt.executeQuery("select * from tab1");
+                while (rs.next())
+                {
+                    for(int i=1 ; i < 7 ; i++)
+                    {
+						System.out.println("Column #: " + i);
+						switch (loop % START_SECOND_HALF)
+						{
+							case 0:
+		                        connectionJdbc20.get_using_object(rs, i);
+								break;
+
+							case 1:
+								if (isDerbyNet)
+									System.out.println("beetle 5350 - JCC returns incorrect result for maxfieldsize()");
+								connectionJdbc20.get_using_string(rs, i);
+								break;
+
+							case 2:
+								connectionJdbc20.get_using_ascii_stream(rs, i);
+								break;
+
+							case 3:
+		                        if(i < 4 ) // only c1 , c2, c3
+				                {
+						            connectionJdbc20.get_using_binary_stream(rs, i);
+								}
+								else
+								{
+									System.out.println("SKIPPING");
+								}
+								break;
+
+							case 4:
+		                        if(i < 4 ) // only c1 , c2, c3
+				                {
+								    connectionJdbc20.get_using_bytes(rs, i);
+								}
+								else
+								{
+									System.out.println("SKIPPING");
+								}
+								break;
+						}
+                    } 
+                }
+                rs.close();
+                loop++;
+            }
+            // make sure that we throw exception for invalid values
+            try{
+                // negative value should throw an exception
+                stmt.setMaxFieldSize(-200);
+            } catch (SQLException e) {
+				if ((e.getMessage() != null &&
+					 e.getMessage().indexOf("Invalid maxFieldSize value") >= 0)
+					|| (e.getSQLState() != null &&
+						(e.getSQLState().equals("XJ066"))))
+					System.out.println("Expected Exception - Invalid maxFieldsize");
+				else System.out.println("Unexpected FAILURE at " +e);
+            }
+            // zero is valid value -- which means unlimited
+            stmt.setMaxFieldSize(0);
+
+			// Do an external sort (forced via properties file),
+			// verifying that streams work correctly
+			System.out.println("Doing external sort");
+
+			testSort(conn, stmt);
+
+			stmt.close();
+			conn.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test maxfieldsize  finished");
+    }
+
+
+    static private void load_data(Connection conn) throws Exception{
+        PreparedStatement pstmt = null;
+
+        try{
+            pstmt = conn.prepareStatement(
+                     "insert into tab1 values(?,?,?,?,?,?)");
+
+            pstmt.setBytes(1, c1_value.getBytes("US-ASCII"));
+            pstmt.setBytes(2, c2_value.getBytes("US-ASCII"));
+            pstmt.setBytes(3, c3_value.getBytes("US-ASCII"));
+            pstmt.setString(4, c4_value);
+            pstmt.setString(5, c5_value);
+            pstmt.setString(6, c6_value);
+            pstmt.execute();
+        }
+		catch(SQLException e)
+		{
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+        }
+		catch(Throwable e )
+		{
+			System.out.println("Fail -- unexpected exception ");
+			e.printStackTrace();
+        }
+		finally
+		{
+             pstmt.close();
+        }
+    }
+
+	private static void testSort(Connection conn, Statement stmt)
+		throws SQLException, java.io.UnsupportedEncodingException
+	{
+		PreparedStatement insertPStmt;
+
+		// Load up a 2nd table using streams where appropriate
+		stmt.execute("create table tab2("+
+									   "c0 int, " +
+                                          "c1 char(100) for bit data,"+
+                                          "c2 varchar(100) for bit data," +
+                                          "c3 long varchar for bit data,"+
+                                          "c4 char(100),"+ 
+                                          "c5 varchar(100),"+
+                                          "c6 long varchar)");
+
+		// Populate the table
+		insertPStmt = conn.prepareStatement(
+						"insert into tab2 values (?, ?, ?, ?, ?, ?, ?)");
+		for (int index = 0; index < 5000; index++)
+		{
+			insertPStmt.setInt(1, index);
+            insertPStmt.setBytes(2, c1_value.getBytes("US-ASCII"));
+            insertPStmt.setBytes(3, c2_value.getBytes("US-ASCII"));
+            insertPStmt.setBytes(4, c3_value.getBytes("US-ASCII"));
+            insertPStmt.setString(5, c4_value);
+            insertPStmt.setString(6, c5_value);
+            insertPStmt.setString(7, c6_value);
+			insertPStmt.executeUpdate();
+		}
+
+		insertPStmt.close();
+
+		// Do sort with maxFieldSize = 0
+		doSort(stmt);
+
+		// Set maxFieldSize to 24 and do another sort
+		stmt.setMaxFieldSize(24);
+		doSort(stmt);
+	}
+
+	private static void doSort(Statement stmt)
+		throws SQLException
+	{
+		System.out.println("Max Field Size = "  + stmt.getMaxFieldSize());
+
+		try
+		{
+			/* Do a descending sort on 1st column, but only select
+			 * out 1st and last 5 rows.  This should test streaming to/from
+			 * a work table.
+			 */
+			rs = stmt.executeQuery("select * from tab2 order by c0 desc");
+			for (int index = 0; index < 5000; index++)
+			{
+				rs.next();
+				if (index < 5 || index >= 4995)
+				{
+					System.out.println("Iteration #: " + index);
+					System.out.println("Column #1: " + rs.getInt(1));
+					System.out.println("Column #2:");
+					connectionJdbc20.get_using_binary_stream(rs, 2);
+					System.out.println("Column #3:");
+					connectionJdbc20.get_using_binary_stream(rs, 3);
+					System.out.println("Column #4:");
+					connectionJdbc20.get_using_binary_stream(rs, 4);
+					System.out.println("Column #5:");
+					connectionJdbc20.get_using_ascii_stream(rs, 5);
+					System.out.println("Column #6:");
+					connectionJdbc20.get_using_ascii_stream(rs, 6);
+					System.out.println("Column #7:");
+					connectionJdbc20.get_using_ascii_stream(rs, 7);
+				}
+			}
+		}
+		catch (SQLException e) 
+		{
+			throw e;
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+	}
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null)
+		{
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+		}
+	}
+
+	static private void dumpExpectedSQLExceptions (SQLException se) {
+		System.out.println("PASS -- expected exception");
+		while (se != null)
+		{
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+        }
+    }
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,146 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.metadataJdbc20
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSetMetaData;
+import java.sql.Statement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+
+/**
+ * Test of database meta-data for new methods in jdbc 20. This program simply calls
+ * each of the new meta-data methods in jdbc20, one by one, and prints the results.
+ *
+ * @author mamta
+ */
+
+public class metadataJdbc20 { 
+	public static void main(String[] args) {
+		DatabaseMetaData met;
+		Connection con;
+		Statement  s;
+
+		System.out.println("Test metadataJdbc20 starting");
+    
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+			con.setAutoCommit(true); // make sure it is true
+
+			s = con.createStatement();
+
+			met = con.getMetaData();
+
+			System.out.println("JDBC Driver '" + met.getDriverName() +
+							   "', version " + met.getDriverMajorVersion() +
+							   "." + met.getDriverMinorVersion() +
+							   " (" + met.getDriverVersion() + ")");
+
+			System.out.println("The URL is: " + met.getURL());
+
+			System.out.println();
+			System.out.println("getUDTs() with user-named types null :");
+ 			dumpRS(met.getUDTs(null, null, null, null));
+      
+			System.out.println("getUDTs() with user-named types in ('JAVA_OBJECT') :");
+ 			int[] userNamedTypes = new int[1];
+ 			userNamedTypes[0] = java.sql.Types.JAVA_OBJECT;
+ 			dumpRS(met.getUDTs("a", null, null, userNamedTypes));
+
+ 			System.out.println("getUDTs() with user-named types in ('STRUCT') :");
+ 			userNamedTypes[0] = java.sql.Types.STRUCT;
+ 			dumpRS(met.getUDTs("b", null, null, userNamedTypes));
+
+ 			System.out.println("getUDTs() with user-named types in ('DISTINCT') :");
+ 			userNamedTypes[0] = java.sql.Types.DISTINCT;
+ 			dumpRS(met.getUDTs("c", null, null, userNamedTypes));
+
+			System.out.println("getUDTs() with user-named types in ('JAVA_OBJECT', 'STRUCT') :");
+ 			userNamedTypes = new int[2];
+ 			userNamedTypes[0] = java.sql.Types.JAVA_OBJECT;
+ 			userNamedTypes[1] = java.sql.Types.STRUCT;
+ 			dumpRS(met.getUDTs("a", null, null, userNamedTypes));
+
+			s.close();
+
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+
+		System.out.println("Test metadataJdbc20 finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se.printStackTrace(System.out);
+			se = se.getNextException();
+		}
+	}
+
+	static void dumpRS(ResultSet s) throws SQLException {
+		ResultSetMetaData rsmd = s.getMetaData ();
+
+		// Get the number of columns in the result set
+		int numCols = rsmd.getColumnCount ();
+
+		if (numCols <= 0) {
+			System.out.println("(no columns!)");
+			return;
+		}
+		
+		// Display column headings
+		for (int i=1; i<=numCols; i++) {
+			if (i > 1) System.out.print(",");
+			System.out.print(rsmd.getColumnLabel(i));
+		}
+		System.out.println();
+	
+		// Display data, fetching until end of the result set
+		while (s.next()) {
+			// Loop through each column, getting the
+			// column data and displaying
+			for (int i=1; i<=numCols; i++) {
+				if (i > 1) System.out.print(",");
+				System.out.print(s.getString(i));
+			}
+			System.out.println();
+		}
+		s.close();
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,14 @@
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+database=jdbc:derby:wombat;create=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+# caching helps out metadata test (reduced from 5 to 3 minutes)
+derby.language.statementCacheSize=1000
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,9 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+substitute=version [0-9].[0-9]..[0-9].[0-9].[0-9][0-9]?.$;version (EXPECTED VERSION),version [0-9].[0-9]..[0-9].[0-9].[0-9][0-9]? Test Build.$;version (EXPECTED VERSION)

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/nullSQLText.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,121 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.nullSQLText
+
+   Copyright 2001, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSetMetaData;
+import java.sql.PreparedStatement;
+import java.sql.Statement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.JDBCTestDisplayUtil;
+
+/**
+ * Test of null strings in prepareStatement and execute 
+ * result set
+ *
+ * @author peachey
+ */
+
+public class nullSQLText { 
+	public static void main(String[] args) {
+		Connection con;
+		PreparedStatement  ps;
+		Statement s;
+		String nullString = null;
+	
+		System.out.println("Test nullSQLText starting");
+    
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+			con.setAutoCommit(true); // make sure it is true
+			s = con.createStatement();
+
+			try
+			{
+				// test null String in prepared statement
+				System.out.println("Test prepareStatement with null argument");
+				ps = con.prepareStatement(nullString);
+			}
+			catch (SQLException e) {
+				System.out.println("FAIL -- expected exception");
+				dumpSQLExceptions(e);
+			}
+			try
+			{
+				// test null String in execute statement
+				System.out.println("Test execute with null argument");
+				s.execute(nullString);
+			}
+			catch (SQLException e) {
+				System.out.println("FAIL -- expected exception");
+				dumpSQLExceptions(e);
+			}
+			try
+			{
+				// test null String in execute query statement
+				System.out.println("Test executeQuery with null argument");
+				s.executeQuery(nullString);
+			}
+			catch (SQLException e) {
+				System.out.println("FAIL -- expected exception");
+				dumpSQLExceptions(e);
+			}
+			try
+			{
+				// test null String in execute update statement
+				System.out.println("Test executeUpdate with null argument");
+				s.executeUpdate(nullString);
+			}
+			catch (SQLException e) {
+				System.out.println("FAIL -- expected exception");
+				dumpSQLExceptions(e);
+			}
+			con.close();
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace(System.out);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+		
+		System.out.println("Test nullSQLText finished");
+    }
+	static private void dumpSQLExceptions (SQLException se) {
+		while (se != null) {
+            JDBCTestDisplayUtil.ShowCommonSQLException(System.out, se);			
+	         se = se.getNextException();
+		}
+	}
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/prepStmtMetaData.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,225 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.prepStmtMetaData
+
+   Copyright 2001, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSetMetaData;
+import java.sql.Statement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+
+/**
+ * Test of prepared statement getMetaData for statements that don't produce a
+ * result set
+ *
+ * @author peachey
+ */
+
+public class prepStmtMetaData { 
+    
+	public static void main(String[] args) {
+		ResultSetMetaData met;
+		Connection con;
+		PreparedStatement  ps;
+		System.out.println("Test prepStmtMetaData starting");
+    
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+			con.setAutoCommit(true); // make sure it is true
+			
+			// test create table - meta data should be null
+			testMetaData(con, "create table ab(a int)", true);
+
+			// test alter table - meta data should be null
+			testMetaData(con, "alter table ab add column b int", true);
+
+			// for test call statement 
+			Statement s = con.createStatement();	
+			s.execute("create procedure testproc() language java external name " +
+				"'org.apache.derbyTesting.functionTests.tests.jdbcapi.prepStmtMetaData.tstmeth'"+
+				" parameter style java");
+
+			// test call statement - shouldn't have meta data
+			testMetaData(con, "call testproc()", false);
+			
+			// test drop procedure - meta data should be null
+			testMetaData(con, "drop procedure testproc", true);
+
+			// test create schema - meta data should be null
+			testMetaData(con, "create schema myschema", true);
+
+			// test drop schema - meta data should be null
+			testMetaData(con, "drop schema myschema restrict", true);
+
+			// test create trigger - meta data should be null
+			//testMetaData(con, "create trigger mytrig after insert on ab for each row mode db2sql create table yy(a int)", true);
+
+			// test drop trigger - meta data should be null
+			//testMetaData(con, "drop trigger mytrig", true);
+
+			// test create view - meta data should be null
+			testMetaData(con, "create view myview as select * from ab", true);
+
+			// test drop view - meta data should be null
+			testMetaData(con, "drop view myview", true);
+
+			// test drop table - meta data should be null
+			testMetaData(con, "drop table ab", false);
+
+			// test create index - meta data should be null
+			testMetaData(con, "create index aindex on ab(a)", true);
+
+			// test drop index - meta data should be null
+			testMetaData(con, "drop index aindex", false);
+
+			// test insert - meta data should be null
+			testMetaData(con, "insert into ab values(1,1)", true);
+
+			// test update - meta data should be null
+			testMetaData(con, "update ab set a = 2", false);
+
+			// test delete - meta data should be null
+			testMetaData(con, "delete from ab", false);
+
+			// test select - meta data should be provided
+			ps = con.prepareStatement("select * from ab");
+			met = ps.getMetaData();
+			System.out.println("Result meta data for select");
+			dumpRSMetaData(met);
+			ps.close();
+
+			// test set 
+			testMetaData(con, "set schema rock", false);
+
+			// bug 4579 : PreparedStatement.getMetaData should not return stale data 
+			executeStmt(con,"create table bug4579 (c11 int)");
+			executeStmt(con,"insert into bug4579 values 1");
+			testMetaData(con, "set schema rick", false);
+			ps = con.prepareStatement("select * from bug4579");
+			met = ps.getMetaData();
+			System.out.println("bug 4579 and 5338 : Result meta data for select *");
+			dumpRSMetaData(met);
+			executeStmt(con,"alter table bug4579 add column c12 int");
+			met = ps.getMetaData();
+			System.out.println("bug 4579 and 5338 : Result meta data for select * after alter table but w/o execute query");
+			dumpRSMetaData(met);
+			executeStmt(con,"alter table bug4579 add column c13 int");
+			ps.execute();
+			met = ps.getMetaData();
+			System.out.println("bug 4579 and 5338 : Result meta data for select * after alter table and execute query");
+			dumpRSMetaData(met);
+			ps.close();
+
+			// clean up
+			executeStmt(con,"drop table ab");
+
+			con.close();
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace(System.out);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+
+		System.out.println("Test prepStmtMetaData finished");
+    }
+	static private void testMetaData(Connection con, String statement, boolean execute) {
+		try {
+			PreparedStatement ps = con.prepareStatement(statement);
+			ResultSetMetaData met = ps.getMetaData();
+			dumpRSMetaData(met);
+			if (execute)
+				ps.execute();
+			ps.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+	}
+	static private void executeStmt(Connection con, String statement) {
+		try {
+			PreparedStatement ps = con.prepareStatement(statement);
+			ps.execute();
+			ps.close();
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:");
+			e.printStackTrace(System.out);
+		}
+	}
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se.printStackTrace(System.out);
+			se = se.getNextException();
+		}
+	}
+	static void dumpRSMetaData(ResultSetMetaData rsmd) throws SQLException {
+		if (rsmd == null || rsmd.getColumnCount() == 0)
+		{
+			System.out.println("ResultSetMetaData is Null or empty");
+			return;
+		}
+
+		// Get the number of columns in the result set
+		int numCols = rsmd.getColumnCount ();
+
+		if (numCols <= 0) {
+			System.out.println("(no columns!)");
+			return;
+		}
+		
+		// Display column headings
+		for (int i=1; i<=numCols; i++) {
+			if (i > 1) System.out.print(",");
+			System.out.print(rsmd.getColumnLabel(i));
+		}
+		System.out.println();
+	}
+
+	public static void tstmeth()
+	{
+		// for purpose of test, method may do nothing
+	}
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,719 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.resultset
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.PreparedStatement;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import java.lang.reflect.*;
+
+import org.apache.derby.tools.ij;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derbyTesting.functionTests.util.JDBCTestDisplayUtil;
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
+/**
+ * Test of JDBC result set and result set meta-data.
+ * This program simply calls each of the result set and result set meta-data
+ * methods, one by one, and prints the results.  The test passes if the printed
+ * results match a previously stored "master".  Thus this test cannot actually
+ * discern whether it passes or not.
+ *
+ * Test is only touching on known result set hot-spots at present.
+ *
+ * @author ames
+ */
+
+public class resultset { 
+
+  private static Class[] CONN_PARAM = { Integer.TYPE };
+  private static Object[] CONN_ARG = { new Integer(JDBC30Translation.CLOSE_CURSORS_AT_COMMIT)};
+
+	static private boolean isDerbyNet = false;
+
+	public static void main(String[] args) {
+
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+
+		Connection con;
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+		String[]  columnNames = {"i", "s", "r", "d", "dt", "t", "ts", "c", "v",
+							 "dc", "bi", "cbd", "vbd", "lvbd", "cl", "bl"};
+
+
+		System.out.println("Test resultset starting");
+
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+			// Test setCatalog/getCatalog for beetle 5504
+			con.setCatalog("mycatalog");
+			String cat = con.getCatalog();
+			if (cat != null )
+				System.out.println("ERROR: getCatalog did not return null");
+			//Use reflection to set the holdability to false so that the test can run in jdk14 and lower jdks as well
+			try {
+				Method sh = con.getClass().getMethod("setHoldability", CONN_PARAM);
+				sh.invoke(con, CONN_ARG);
+			} catch (Exception e) {System.out.println("shouldn't get that error " + e.getMessage());}//for jdks prior to jdk14
+
+			stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+									   ResultSet.CONCUR_UPDATABLE);
+			
+			// REMIND: might want a usertype case as well...
+			stmt.execute("create table t (i int, s smallint, r real, "+
+				"d double precision, dt date, t time, ts timestamp, "+
+				"c char(10), v varchar(40) not null, dc dec(10,2),"+
+				"bi bigint, cbd char(10) for bit data," +
+				"vbd varchar(10) for bit data,lvbd long varchar for bit data,"+
+				"cl clob(2G), bl blob(1G) )");
+			stmt.execute("insert into t values(1,2,3.3,4.4,date('1990-05-05'),"+
+						 "time('12:06:06'),timestamp('1990-07-07 07:07:07.000007'),"+
+						 "'eight','nine', 10.1, 11," + 
+						 TestUtil.stringToHexLiteral("twelv") +  "," +
+						 TestUtil.stringToHexLiteral("3teen") +  "," +
+						 TestUtil.stringToHexLiteral("4teen") +  ", null, null)" );
+
+
+			rs = stmt.executeQuery("select i, s, r, d, dt, t, ts, c, v, dc, bi, cbd, vbd, lvbd, cl, bl from t");
+			met = rs.getMetaData();
+
+			int colCount;
+			System.out.println("getColumnCount(): "+(colCount=met.getColumnCount()));
+
+			// JDBC columns use 1-based counting
+			for (int i=1;i<=colCount;i++) {
+				System.out.println("isAutoIncrement("+i+"): "+met.isAutoIncrement(i));
+				System.out.println("isCaseSensitive("+i+"): "+met.isCaseSensitive(i));
+				System.out.println("isSearchable("+i+"): "+met.isSearchable(i));
+				System.out.println("isCurrency("+i+"): "+met.isCurrency(i));
+				System.out.println("isNullable("+i+"): "+met.isNullable(i));
+				System.out.println("isSigned("+i+"): "+met.isSigned(i));
+				System.out.println("getColumnDisplaySize("+i+"): "+met.getColumnDisplaySize(i));
+				System.out.println("getColumnLabel("+i+"): "+met.getColumnLabel(i));
+				System.out.println("getColumnName("+i+"): "+met.getColumnName(i));
+				// beetle 5323
+				System.out.println("getTableName("+i+"): "+met.getTableName(i));
+				System.out.println("getSchemaName("+i+"): "+met.getSchemaName(i));
+				System.out.println("getCatalogName("+i+"): "+met.getCatalogName(i));
+				System.out.println("getColumnType("+i+"): "+met.getColumnType(i));
+				System.out.println("getPrecision("+i+"): "+met.getPrecision(i));
+				System.out.println("getScale("+i+"): "+met.getScale(i));
+				System.out.println("getColumnTypeName("+i+"): "+met.getColumnTypeName(i));
+				System.out.println("isReadOnly("+i+"): "+met.isReadOnly(i));
+				boolean writable = met.isWritable(i);
+				// JCC Supports updatable resultsets so isWritable is true
+				if ((isDerbyNet && writable == true) || 
+					(!isDerbyNet && writable == false))
+					System.out.println("isWritable("+i+"): Expected isWritable value");
+				System.out.println("isDefinitelyWritable("+i+"): "+met.isDefinitelyWritable(i));
+			}
+
+			/* Try the various get methods on each column */
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+				for (int i=1;i<=colCount;i++) {
+					try {
+						System.out.println("getBigDecimal("+i+",1): "+
+													rs.getBigDecimal(i, 1));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getBigDecimal("+i+",1) got exception ");
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						if (isDerbyNet)
+							System.out.println("beetle 5328 - JCC returns incorrect scale for getBigDecimal(String,int)");
+						System.out.println("getBigDecimal("+
+										columnNames[i-1]+ ",1): "+
+										rs.getBigDecimal(columnNames[i-1], 1));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getBigDecimal("+
+							columnNames[i-1]+",1) got exception ");
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getBoolean("+i+"): "+
+													rs.getBoolean(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getBoolean("+i+") got exception ");
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getBoolean("+
+										columnNames[i-1]+ "): "+
+										rs.getBoolean(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getBoolean("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getByte("+i+"): "+
+													rs.getByte(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getByte("+i+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+	 				}
+
+					try {
+						System.out.println("getByte("+
+										columnNames[i-1]+ "): "+
+										rs.getByte(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getByte("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getBytes("+i+"): "+
+													showBytes(rs.getBytes(i)));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getBytes("+i+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getBytes("+
+										columnNames[i-1]+ "): "+
+										showBytes(rs.getBytes(columnNames[i-1])));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getBytes("+
+							columnNames[i-1]+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getDate("+i+"): "+
+													rs.getDate(i));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getDate("+i+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getDate("+
+										columnNames[i-1]+ "): "+
+										rs.getDate(columnNames[i-1]));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getDate("+
+							columnNames[i-1]+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getDouble("+i+"): "+
+													rs.getDouble(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getDouble("+i+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getDouble("+
+										columnNames[i-1]+ "): "+
+										rs.getDouble(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getDouble("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getFloat("+i+"): "+
+													rs.getFloat(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getFloat("+i+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getFloat("+
+										columnNames[i-1]+ "): "+
+										rs.getFloat(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getFloat("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getInt("+i+"): "+
+													rs.getInt(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getInt("+i+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getInt("+
+										columnNames[i-1]+ "): "+
+										rs.getInt(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getInt("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getLong("+i+"): "+
+													rs.getLong(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getLong("+i+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getLong("+
+										columnNames[i-1]+ "): "+
+										rs.getLong(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getLong("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						// with the bit datatypes the string output is not the same for every run,
+						// so we need to mask that to prevent false test failures
+						// this does not test the values returned, just whether it gives an exception.
+						if (i>11)
+						{
+							rs.getObject(i);
+							System.out.println("getObject("+i+") is ok");
+						}
+						else
+							System.out.println("getObject("+i+"): "+
+													rs.getObject(i));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getObject("+i+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						// with the bit datatypes the string output is not the same for every run,
+						// so we need to mask that to prevent false test failures
+						// this does not test the values returned, just whether it gives an exception.
+						if (i>11)
+						{
+							rs.getObject(columnNames[i-1]);
+							System.out.println("getObject("+columnNames[i-1]+") is ok ");
+						}
+						else
+							System.out.println("getObject("+
+										columnNames[i-1]+ "): "+
+										rs.getObject(columnNames[i-1]));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getObject("+
+							columnNames[i-1]+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getShort("+i+"): "+
+													rs.getShort(i));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getShort("+i+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getShort("+
+										columnNames[i-1]+ "): "+
+										rs.getShort(columnNames[i-1]));
+					}
+					catch (Throwable e) {
+						System.out.println(
+							"getShort("+
+							columnNames[i-1]+") got exception " );
+						if (e instanceof SQLException)
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getString("+i+"): "+
+													rs.getString(i));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getString("+i+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+					
+					try {
+						System.out.println("getString("+
+										columnNames[i-1]+ "): "+
+										rs.getString(columnNames[i-1]));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getString("+
+							columnNames[i-1]+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getTime("+i+"): "+
+													rs.getTime(i));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getTime("+i+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getTime("+
+										columnNames[i-1]+ "): "+
+										rs.getTime(columnNames[i-1]));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getTime("+
+							columnNames[i-1]+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getTimestamp("+i+"): "+
+													rs.getTimestamp(i));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getTimestamp("+i+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+
+					try {
+						System.out.println("getTimestamp("+
+										columnNames[i-1]+ "): "+
+										rs.getTimestamp(columnNames[i-1]));
+					}
+					catch (SQLException e) {
+						System.out.println(
+							"getTimestamp("+
+							columnNames[i-1]+") got exception " );
+						JDBCTestDisplayUtil.ShowCommonSQLException(System.out, (SQLException)e);
+					}
+				}
+			}
+
+			rs.close();
+
+			// Try getting a row from the closed result set
+			try {
+				rs.next();
+				System.out.println(
+					"FAIL - rs.next() allowed on closed result set.");
+			}
+			catch (SQLException e) {
+				System.out.println(
+					"rs.next() on closed result set got exception " );
+				JDBCTestDisplayUtil.ShowCommonSQLException(System.out, e);
+			}
+			catch (Throwable e) {
+				System.out.println("rs.next() didn't fail with SQLException as "+
+					"expected on closed result set.  Got Throwable instead: "+e);
+			}
+
+			// Ensure commit or rollback in auto commit actually does something
+			stmt.executeUpdate("create table bug4810(i int, b int)");
+			stmt.executeUpdate("insert into bug4810 values (1,1), (1,2), (1,3), (1,4)");
+			stmt.executeUpdate("insert into bug4810 values (1,1), (1,2), (1,3), (1,4)");
+			con.commit();
+			con.setAutoCommit(true);
+			con.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
+			System.out.println("just auto commit");
+			showLocksForAutoCommitSelect(con, stmt, 0);
+			System.out.println("commit with auto commit");
+			showLocksForAutoCommitSelect(con, stmt, 1);
+			System.out.println("rollback with auto commit");
+			showLocksForAutoCommitSelect(con, stmt, 2);
+
+
+			stmt.close();
+
+			testMutableValues(con);
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test resultset finished");
+    }
+
+
+	static private void doTheTests() throws Exception
+	{
+
+	}
+
+	static private void showLocksForAutoCommitSelect(Connection conn, Statement stmt, int action) throws Exception {
+
+		ResultSet rs = stmt.executeQuery("select i,b from bug4810");
+		rs.next();
+		System.out.println("  bug4810 " + rs.getInt(1) + ", " + rs.getInt(2));
+		rs.next();
+		System.out.println("  bug4810 " + rs.getInt(1) + ", " + rs.getInt(2));
+
+		if (action == 1) {
+			System.out.println("commit");
+			conn.commit();
+		} else if (action == 2) {
+			System.out.println("rollback");
+			conn.rollback();
+		}
+
+		showLocks();
+
+		try {
+
+			rs.next();
+			System.out.println("  bug4810 " + rs.getInt(1) + ", " + rs.getInt(2));
+		} catch (SQLException sqle) {
+			JDBCTestDisplayUtil.ShowCommonSQLException(System.out, sqle);		}
+		showLocks();
+		rs.close();
+
+		showLocks();
+
+	}
+
+	private static void showLocks() throws Exception {
+		System.out.println("  LOCK TABLE");
+		Connection con2 = ij.startJBMS();
+		PreparedStatement ps2 = con2.prepareStatement("select XID, count(*) from new org.apache.derby.diag.LockTable() as L group by XID");
+		ResultSet rs2 = ps2.executeQuery();
+
+		while (rs2.next()) {
+			if (rs2.getInt(2) > 0) {
+				System.out.println("Locks are held");
+			} else if (rs2.getInt(2) == 0) {
+				System.out.println("No locks to hold");
+			}
+		}
+		
+		rs2.close();
+		ps2.close();
+		con2.close();
+	}
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+            JDBCTestDisplayUtil.ShowCommonSQLException(System.out, se);			
+	         se = se.getNextException();
+		}
+	}
+
+	static private String showBytes(byte[] bytes) {
+		if (bytes == null)
+			return "null";
+
+		StringBuffer s = new StringBuffer("0x");
+		s.ensureCapacity(2+2*bytes.length);
+		for (int i=0;i<bytes.length;i++) {
+			int hi = (bytes[i] & 0xf0) >>> 4;
+			int lo = (bytes[i] & 0x0f);
+			s.append(representation[hi]);
+			s.append(representation[lo]);
+		}
+		return s.toString();
+	}
+
+	static final char[] representation =
+		{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+		  'A', 'B', 'C', 'D', 'E', 'F' } ;
+
+
+	/**
+		Test that for mutable types returned from a ResultSet we do not
+		re-use the type, thus conusing any application that holds onto
+		the returned value. Possible mutable types are
+
+		byte[]
+		java.sql.Date
+		java.sql.Timestamp
+		java.sql.Time
+
+		The stream types are mutable but they are closed once the appliction
+		moves to the next column or row.
+	*/
+	private static void testMutableValues(Connection conn) throws SQLException 
+	{
+		System.out.println("START testMutableValues");
+
+		Statement s = conn.createStatement();
+
+		s.execute("CREATE TABLE MUTABLE.T1(C CHAR(10) FOR BIT DATA, V VARCHAR(10) FOR BIT DATA, L LONG VARCHAR FOR BIT DATA, D DATE, T TIME, TS TIMESTAMP)");
+		s.execute("INSERT INTO MUTABLE.T1 VALUES (X'34', X'4de5', X'5e3a67', '1992-01-01', '17.05.00', '2003-3-1-17.05.43.123456')");
+		s.execute("INSERT INTO MUTABLE.T1 VALUES (X'93', X'4825', X'6e3a64', '1992-01-03', '17.06.00', '2007-3-1-17.05.43.123456')");
+		s.execute("INSERT INTO MUTABLE.T1 VALUES (X'34', X'4de5', X'5e3a67', '1992-01-01', '17.05.00', '2003-3-1-17.05.43.123456')");
+
+		{
+		ResultSet rs = s.executeQuery("SELECT C,V,L,D,T,TS FROM MUTABLE.T1");
+		java.util.ArrayList[] values = new java.util.ArrayList[6];
+		for (int i = 0; i < values.length; i++) {
+			values[i] = new java.util.ArrayList();
+		}
+		System.out.println("CHECKING on getXXX()");
+		int rc = 0;
+		while (rs.next()) {
+			rc++;
+			System.out.println("ROW " + rc);
+
+			checkMutableValue(values[0], 1, rs.getBytes(1));
+			checkMutableValue(values[1], 2, rs.getBytes(2));
+			checkMutableValue(values[2], 3, rs.getBytes(3));
+
+			checkMutableValue(values[3], 4, rs.getDate(4));
+			checkMutableValue(values[4], 5, rs.getTime(5));
+			checkMutableValue(values[5], 6, rs.getTimestamp(6));
+
+		}
+		rs.close();
+		}
+		{
+		ResultSet rs = s.executeQuery("SELECT C,V,L,D,T,TS FROM MUTABLE.T1");
+		java.util.ArrayList[] values = new java.util.ArrayList[6];
+		for (int i = 0; i < values.length; i++) {
+			values[i] = new java.util.ArrayList();
+		}
+		System.out.println("CHECKING on getObject()");
+		int rc = 0;
+		while (rs.next()) {
+			rc++;
+			System.out.println("ROW " + rc);
+
+			for (int i = 0; i < 6; i++)
+				checkMutableValue(values[i], i+1, rs.getObject(i+1));
+		}
+		rs.close();
+		}
+
+		s.execute("DROP TABLE MUTABLE.T1");
+
+		System.out.println("COMPLETE testMutableValues");
+	}
+
+	private static void checkMutableValue(java.util.ArrayList list, int col, Object value) {
+
+		int same = -1;
+		int equals = -1;
+		for (int i = 0; i < list.size(); i++) {
+			Object previous = list.get(i);
+			if (previous == value)
+				same = i+1;
+			if (previous.equals(value))
+				equals = i+1;
+		}
+
+		if (same != -1)
+			System.out.println("FAIL SAME OBJECT RETURNED column " + col + " existing " + same);
+		if (equals != -1)
+			System.out.println("OK EQUALITY OBJECT RETURNED column " + col + " existing " + equals);
+
+		list.add(value);
+	}
+}
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc20.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,118 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.resultsetJdbc20
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test of additional methods in JDBC2.0 result set meta-data.
+ * This program simply calls each of the additional result set meta-data
+ * methods, one by one, and prints the results.
+ *
+ */
+
+public class resultsetJdbc20 { 
+	public static void main(String[] args) {
+		Connection con;
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+		String[]  columnNames = {"i", "s", "r", "d", "dt", "t", "ts", "c", "v", "dc"};
+
+		System.out.println("Test resultsetJdbc20 starting");
+
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+			stmt = con.createStatement();
+
+      //create a table, insert a row, do a select from the table,
+      //get the resultset meta data and go through each column in
+      //the selection list and get it's column class name.
+			stmt.execute("create table t (i int, s smallint, r real, "+
+				"d double precision, dt date, t time, ts timestamp, "+
+				"c char(10), v varchar(40) not null, dc dec(10,2))");
+			stmt.execute("insert into t values(1,2,3.3,4.4,date('1990-05-05'),"+
+						 "time('12:06:06'),timestamp('1990-07-07 07:07:07.07'),"+
+						 "'eight','nine', 10.1)");
+
+			rs = stmt.executeQuery("select * from t");
+			met = rs.getMetaData();
+
+			int colCount;
+			System.out.println("getColumnCount(): "+(colCount=met.getColumnCount()));
+
+			// JDBC columns use 1-based counting
+			for (int i=1;i<=colCount;i++) {
+				// this test suffers from bug 5775.
+				// this if should be removed if the bug is fixed.	
+				if (i==2 && (met.getColumnClassName(i).equals("java.lang.Short")))
+				{
+					System.out.println("getColumnName("+i+"): "+met.getColumnName(i));
+					//System.out.println("getColumnClassName("+i+"): "+met.getColumnClassName(i));
+					System.out.println("FAIL: should be java.lang.Integer - but is java.lang.Short. see beetle 5775");	
+				}
+				else
+				{
+					System.out.println("getColumnName("+i+"): "+met.getColumnName(i));
+					System.out.println("getColumnClassName("+i+"): "+met.getColumnClassName(i));
+				}
+			}
+
+			rs.close();
+
+			stmt.close();
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test resultsetJdbc20 finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+		}
+	}
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,182 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.resultsetJdbc30
+
+   Copyright 2001, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Array;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.derby.tools.ij;
+
+/**
+ * Test of additional methods in JDBC3.0 result set
+ *
+ */
+
+public class resultsetJdbc30 { 
+	public static void main(String[] args) {
+		Connection con;
+		ResultSet rs;
+		Statement stmt;
+		String[]  columnNames = {"i", "s", "r", "d", "dt", "t", "ts", "c", "v", "tn", "dc"};
+
+		System.out.println("Test resultsetJdbc30 starting");
+
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+
+			stmt = con.createStatement();
+
+      //create a table, insert a row, do a select from the table,
+			stmt.execute("create table t (i int, s smallint, r real, "+
+				"d double precision, dt date, t time, ts timestamp, "+
+				"c char(10), v varchar(40) not null, dc dec(10,2))");
+			stmt.execute("insert into t values(1,2,3.3,4.4,date('1990-05-05'),"+
+						 "time('12:06:06'),timestamp('1990-07-07 07:07:07.07'),"+
+						 "'eight','nine', 11.1)");
+
+			rs = stmt.executeQuery("select * from t");
+			rs.next();
+
+			//following will give not implemented exceptions.
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.getURL(int) :");
+			  rs.getURL(8);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.getURL(String) :");
+			  rs.getURL("c");
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateRef(int, Ref) :");
+			  rs.updateRef(8,null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateRef(String, Ref) :");
+			  rs.updateRef("c",null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateBlob(int, Blob) :");
+			  rs.updateBlob(8,null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateBlob(String, Blob) :");
+			  rs.updateBlob("c",null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateClob(int, Clob) :");
+			  rs.updateClob(8,null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateClob(String, Clob) :");
+			  rs.updateClob("c",null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateArray(int, Array) :");
+			  rs.updateArray(8,null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			try {
+			  System.out.println();
+			  System.out.println("trying rs.updateClob(String, Array) :");
+			  rs.updateArray("c",null);
+			  System.out.println("Shouldn't reach here. Method not implemented yet.");
+ 			} catch (SQLException ex) {
+			  System.out.println("Expected : " + ex.getMessage());
+ 			}
+
+			rs.close();
+
+			stmt.close();
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test resultsetJdbc30 finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+		}
+	}
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,28 @@
+#
+# This is the default system properties file for SQL and JAVA tests.
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  
+# *** THEY BELONG IN default_derby.properties.
+#
+# This file will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij to load the driver and make an
+# initial connection to the database.
+#
+# The .java test has to call util.getPropertyArg and util.startJBMS
+# to process the property file.  See any of the .java tests for this code.
+#
+# If you want to alter these to use a different driver, connect to a different
+# database, or to not be used, override this file by creating
+# a file <testname>_app.properties to be used instead of this file.
+#
+database=jdbc:derby:wombat;create=true
+derby.optimizer.noTimeout=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+
+runwithibm13=false
+runwithjdk13=false
+runwithj9=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetJdbc30_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,9 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+substitute=Expected : JDBC 3 method called - not yet supported;Expected : Feature not implemented: no details.

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.gif
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.gif?view=auto&rev=124918
==============================================================================
Binary file. No diff available.

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,305 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.resultsetStream
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.sql.PreparedStatement;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.BufferedInputStream;
+import java.util.zip.CRC32;
+
+/**
+ * Test of JDBC result set Stream calls.
+ *
+ * @author djd
+ */
+
+
+public class resultsetStream { 
+    
+	public static void main(String[] args) {
+		Connection con;
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		System.out.println("Test resultsetStream starting");
+
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+
+			stmt = con.createStatement();
+
+			stmt.execute("create table t2 (len int, data LONG VARCHAR FOR BIT DATA)");
+			PreparedStatement ppw = con.prepareStatement(
+				"insert into t2 (len, data) values (?, ?)");
+			File file = new File("extin/littleclob.txt");
+			int fileSize = (int) file.length();
+			BufferedInputStream fileData = new BufferedInputStream(new FileInputStream(file));
+			ppw.setInt(1, fileSize);
+			ppw.setBinaryStream(2, fileData, fileSize);
+			ppw.executeUpdate();
+
+			file = new File("extin/short.txt");
+			fileSize = (int) file.length();
+			fileData = new BufferedInputStream(new FileInputStream(file));
+			ppw.setInt(1, fileSize);
+			ppw.setBinaryStream(2, fileData, fileSize);
+			ppw.executeUpdate();
+			// null binary value
+			ppw.setInt(1, -1);
+			ppw.setBinaryStream(2, (java.io.InputStream) null, 0);
+			ppw.executeUpdate();
+
+			// value copied over from original Java object test.
+			File rssg = new java.io.File("extin/resultsetStream.gif");
+			int rssgLength = (int) rssg.length();
+			ppw.setInt(1, (int) rssgLength);
+			ppw.setBinaryStream(2, new FileInputStream(rssg), rssgLength);
+			ppw.executeUpdate();
+
+			// try binary stream processing on a known file.
+			rs = stmt.executeQuery("select data from t2 where len = "
+									+ rssgLength);
+			met = rs.getMetaData();
+			System.out.println("getColumnCount(): "+  met.getColumnCount());
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as a stream
+				try {
+
+					InputStream is = rs.getBinaryStream(1);
+					if (is == null) {
+						System.out.println("FAIL - getBinaryStream() return null");
+					    break;
+					}
+
+					// read the first 200 bytes from the stream and checksum them
+					byte[] b200 = new byte[200];
+
+					// no guaratees to read all 200 bytes in one read call.
+					int count = 0;
+
+					while (count < 200) {
+						int r = is.read(b200, count, 200-count);
+						if (r == -1)
+							break;
+						count += r;
+					}
+
+					if (count != 200){
+						System.out.println("FAIL - failed to read 200 bytes from known file");
+						break;
+					}
+
+					CRC32 cs = new CRC32();
+
+					cs.reset();
+					cs.update(b200);
+
+					System.out.println("Checksum of first 200 bytes " + cs.getValue());
+
+					count = 200;
+					for (;  is.read() != -1; count++) {
+					}
+					System.out.println("Size of file = " + count);
+					is.close();
+				}
+				catch (Throwable e) {
+					System.out.println(
+						"FAIL - exection while processing valid file");
+					if (e instanceof SQLException)
+					JDBCDisplayUtil.ShowSQLException(System.out, (SQLException)e);
+				}
+			}
+			rs.close();
+
+			// check the stream is closed once another get call is made.
+			rs = stmt.executeQuery("select data, len from t2 where len = "
+									+ rssgLength);
+			met = rs.getMetaData();
+			System.out.println("getColumnCount(): "+ met.getColumnCount());
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as a stream
+				try {
+
+					InputStream is = rs.getBinaryStream(1);
+					if (is == null) {
+						System.out.println("FAIL - getBinaryStream() return null");
+					    break;
+					}
+
+					// read the first 200 bytes from the stream and checksum them
+					byte[] b200 = new byte[200];
+
+					// no guaratees to read all 200 bytes in one read call.
+					int count = 0;
+
+					while (count < 200) {
+						int r = is.read(b200, count, 200-count);
+						if (r == -1)
+							break;
+						count += r;
+					}
+
+					if (count != 200){
+						System.out.println("FAIL - failed to read 200 bytes from known file");
+						break;
+					}
+
+					CRC32 cs = new CRC32();
+
+					cs.reset();
+					cs.update(b200);
+
+					System.out.println("Checksum of first 200 bytes " + cs.getValue());
+
+					System.out.println("second columns is " + rs.getInt(2));
+
+					System.out.println("FAILS DUE TO BUG 5710");
+					try {
+						is.read();
+						System.out.println("FAIL - stream was not closed after a get*() call. " + is.getClass());
+						break;
+					} catch (IOException ioe) {
+						// yes, stream should be closed
+					}
+				}
+				catch (Throwable e) {
+					System.out.println(
+						"FAIL - exection while processing valid file");
+					if (e instanceof SQLException)
+					JDBCDisplayUtil.ShowSQLException(System.out, (SQLException)e);
+				}
+			}
+			rs.close();
+
+			// check a SQL null object gets a null stream
+			rs = stmt.executeQuery("select data from t2 where len = -1");
+			met = rs.getMetaData();
+			System.out.println("getColumnCount(): "+ met.getColumnCount());
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as a stream
+
+				InputStream is = rs.getBinaryStream(1);
+				if (is != null) {
+					System.out.println("FAIL - getBinaryStream() did not return null for SQL null");
+					break;
+				}
+
+			}
+			rs.close();
+
+			rs = stmt.executeQuery("select len, data from t2 where len = "
+									+ fileSize);
+			rs.next();
+			fileSize = rs.getInt(1);
+			fileData = new BufferedInputStream(rs.getBinaryStream(2));
+			int readCount = 0;
+			while(true)
+			{
+				int data = fileData.read();
+				if (data == -1) break;
+				readCount++;
+			}
+			fileData.close();
+			System.out.println("len=" + fileSize);
+			System.out.println("number of reads=" + readCount);
+
+			// check binary input streams of invalid length.
+			// JDBC 3.0 tutorial says stream contents must match length.
+
+			byte[] tooFew = new byte[234];
+
+			ppw.setInt(1, 234);
+			ppw.setBinaryStream(2, new java.io.ByteArrayInputStream(tooFew), 234); // matching length
+			ppw.executeUpdate();
+
+
+			ppw.setInt(1, 235);
+			ppw.setBinaryStream(2, new java.io.ByteArrayInputStream(tooFew), 235); // too few bytes in stream
+			try {
+				ppw.executeUpdate();
+				System.out.println("FAIL - execute with setBinaryStream() with too few bytes succeeded");
+			} catch (SQLException sqle) {
+				org.apache.derbyTesting.functionTests.util.TestUtil.dumpSQLExceptions(sqle, true);
+			}
+
+			ppw.setInt(1, 233);
+			ppw.setBinaryStream(2, new java.io.ByteArrayInputStream(tooFew), 233); // too many bytes
+			try {
+				ppw.executeUpdate();
+				System.out.println("FAIL - execute with setBinaryStream() with too many bytes succeeded");
+			} catch (SQLException sqle) {
+				org.apache.derbyTesting.functionTests.util.TestUtil.dumpSQLExceptions(sqle, true);
+			}
+
+
+			ppw.close();
+			rs.close();
+			stmt.close();
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+			e.printStackTrace();
+		}
+
+		System.out.println("Test resultsetStream finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception: " + se.toString());
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se = se.getNextException();
+		}
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+supportfiles=tests/jdbcapi/resultsetStream.gif,tests/jdbcapi/littleclob.txt,tests/jdbcapi/short.txt
+usedefaults=true
+useextdirs=true

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/savepointJdbc30.java	Tue Jan 11 11:53:57 2005
@@ -67,7 +67,7 @@
 			setUpTest(s);
 
 			//JCC translates the JDBC savepoint calls into equivalent SQL statements.
-			//In addition, (in order to stay DB2 LUW compatible), we do not allow nested savepoints when
+			//In addition, we do not allow nested savepoints when
 			//coming through SQL statements. Because of this restriction, we can't run most of the
 			//JDBC savepoint tests under DRDA framework. The JDBC tests have nested JDBC savepoint
 			//calls and they fail when run under JCC(because they get translated into nested SQL savepoints).
@@ -96,7 +96,7 @@
 
 	//The following tests have nested savepoints through JDBC calls. When coming through JCC,
 	//these nested JDBC savepoint calls are translated into equivalent SQL savepoint statements.
-	//But for DB2 LUW compatibility, we do not allow nested savepoints coming through SQL statments
+	//But we do not allow nested savepoints coming through SQL statments
 	//and hence these tests can't be run under DRDA framework.
 	static void nonDRDATests(Connection con, Statement s)
 					throws SQLException {
@@ -277,7 +277,6 @@
 
 		// Test 48
 		System.out.println("Test 48 No nested SQL savepoints allowed.");
-		System.out.println("This is to match DB2 LUW behavior");
 		savepoint1 = con.setSavepoint();
 		savepoint2 = con.setSavepoint();
 		System.out.println("Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint");
@@ -694,7 +693,7 @@
 		con.rollback();
 
 		// Test 17
-		System.out.println("Test 17 No nested savepoints allowed when using SQL to set savepoints. This is to match DB2 LUW behavior");
+		System.out.println("Test 17 No nested savepoints allowed when using SQL to set savepoints.");
 		System.out.println("Test 17a Test with UNIQUE clause.");
 		s.executeUpdate("SAVEPOINT s1 UNIQUE ON ROLLBACK RETAIN LOCKS ON ROLLBACK RETAIN CURSORS");
 		try {
@@ -720,7 +719,6 @@
 
 		// Test 18
 		System.out.println("Test 18 No nested SQL savepoints allowed inside JDBC savepoint.");
-		System.out.println("This is to match DB2 LUW behavior");
 		savepoint1 = con.setSavepoint();
 		System.out.println("Following SQL savepoint will fail because we are trying to nest it inside JDBC savepoint");
 		try {
@@ -736,7 +734,6 @@
 
 		// Test 19
 		System.out.println("Test 19 No nested SQL savepoints allowed inside SQL savepoint.");
-		System.out.println("This is to match DB2 LUW behavior");
 		s.executeUpdate("SAVEPOINT s1 ON ROLLBACK RETAIN LOCKS ON ROLLBACK RETAIN CURSORS");
 		System.out.println("Following SQL savepoint will fail because we are trying to nest it inside SQL savepoint");
 		try {

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/searchclob.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/searchclob.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/searchclob.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,50 @@
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
+wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,144 @@
+--
+-- Specifically test SECURE users and various authentication
+-- service/scheme configuration for different databases.
+--
+
+-- Configure the 6 different databases with for each
+-- of them, a different authentication scheme.
+--
+-- 'wombat'				- default DERBY scheme &
+--						  users known at system level.
+--						  Some authorization restriction.
+-- 'guestSchemeDB'		- No authentication
+-- 'derbySchemeDB'	- BUILTIN authentication
+--						  & some db authorization restriction.
+-- 'simpleSchemeDB'		- BUILTIN authentication and
+--						  some db authorization restriction.
+--                        (was the old Cloudscape 1.5 simple scheme)
+--
+-- let's create all the dbs and configure them.
+-- we will authenticate using a default system user that we
+-- have configured.
+-- A typical bad guy who cannot access any database but guest
+-- is Jamie.
+--
+
+--
+-- 'guestSchemeDB' database authentication/authorization config
+--
+connect 'guestSchemeDB;create=true;user=system;password=manager';
+-- override requireAuthentication to be turned OFF at the database level
+autocommit off;
+prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p1 using 'values(''derby.connection.requireAuthentication'', ''false'')';
+commit;
+autocommit on;
+
+--
+-- 'derbySchemeDB' database authentication/authorization config
+--
+connect 'derbySchemeDB;create=true;user=system;password=manager';
+autocommit off;
+prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p2 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+-- let's define users in this database (other than the ones
+-- known at the system level. This is for the test
+-- These 3 users will only be known in this database
+execute p2 using 'values(''derby.user.martin'', ''obfuscateIt'')';
+execute p2 using 'values(''derby.user.dan'', ''makeItFaster'')';
+execute p2 using 'values(''derby.user.mamta'', ''ieScape'')';
+execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+commit;
+autocommit on;
+
+--
+-- 'simpleSchemeDB' database authentication/authorization config
+--
+connect 'simpleSchemeDB;create=true;user=system;password=manager';
+autocommit off;
+prepare p5 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p5 using 'values(''derby.authentication.provider'', ''BUILTIN'')';
+
+--
+--  only allow these 3 users
+execute p5 using 'values(''derby.database.fullAccessUsers'', ''system,jeff,howardR'')';
+execute p5 using 'values(''derby.database.readOnlyAccessUsers'', ''francois'')';
+-- no access to Jamie only as he's a well known hooligan
+execute p5 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+commit;
+autocommit on;
+
+--
+-- Shutdown the system for database properties to take effect
+--
+disconnect all;
+connect 'wombat;user=system;password=manager;shutdown=true';
+connect 'guestSchemeDB;user=system;password=manager;shutdown=true';
+connect 'derbySchemeDB;user=system;password=manager;shutdown=true';
+connect 'simpleSchemeDB;user=system;password=manager;shutdown=true';
+disconnect all;
+
+-- shuting down the system causes IJ to loose the protocol, therefore
+-- we'd be doomed :(
+#connect ';shutdown=true;user=system;password=manager';
+
+-- 1) Valid authentication & authorization requests/ops
+-- 
+connect 'wombat;create=true;user=kreg;password=IwasBornReady';
+connect 'wombat;user=jeff;password=homeRun';
+connect 'wombat;user=howardR;password=takeItEasy';
+connect 'wombat;user=francois;password=paceesalute';
+-- Invalid ones:
+connect 'wombat;user=Jamie;password=theHooligan';
+show connections;
+
+connect 'guestSchemeDB;user=kreg;password=IwasBornReady';
+connect 'guestSchemeDB;user=jeff;password=homeRun';
+connect 'guestSchemeDB;user=howardR;password=takeItEasy';
+connect 'guestSchemeDB;user=francois;password=paceesalute';
+-- Invalid ones:
+connect 'guestSchemeDB;user=Jamie;password=theHooligan';
+show connections;
+
+connect 'derbySchemeDB;user=mamta;password=ieScape';
+connect 'derbySchemeDB;user=dan;password=makeItFaster';
+connect 'derbySchemeDB;user=martin;password=obfuscateIt';
+-- Invalid ones:
+connect 'derbySchemeDB;user=Jamie;password=theHooligan';
+connect 'derbySchemeDB;user=francois;password=paceesalute';
+show connections;
+
+connect 'simpleSchemeDB;user=jeff;password=homeRun';
+connect 'simpleSchemeDB;user=howardR;password=takeItEasy';
+connect 'simpleSchemeDB;user=francois;password=paceesalute';
+-- Read-only user
+create table t1 (c1 int);
+-- Invalid ones:
+connect 'simpleSchemeDB;user=Jamie;password=theHooligan';
+connect 'simpleSchemeDB;user=dan;password=makeItFaster';
+connect 'simpleSchemeDB;user=francois;password=corsica';
+show connections;
+disconnect all;
+
+show connections;
+
+-- Database shutdown - check user - should fail
+connect 'derbySchemeDB;shutdown=true';
+
+show connections;
+
+-- Database shutdown - check user - should succeed
+connect 'wombat;user=jeff;password=homeRun;shutdown=true';
+connect 'guestSchemeDB;user=kreg;password=IwasBornReady;shutdown=true';
+connect 'derbySchemeDB;user=mamta;password=ieScape;shutdown=true';
+connect 'simpleSchemeDB;user=jeff;password=homeRun;shutdown=true';
+
+show connections;
+
+-- Derby system shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+
+disconnect all;
+
+-- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,37 @@
+--
+-- Negative test for SECURE users. This tries to authenticate against an LDAP
+-- server on a machine which is not accessible/doesn't exist.
+--
+
+-- 'ldapSchemeDB'		- LDAP authentication (on NT thru LDAP)
+-- let's create the db and configure it.
+-- we will authenticate using a default system user that we have configured.
+--
+-- 'ldapSchemeDB' database authentication/authorization config
+--
+connect 'ldapSchemeDB;create=true;user=system;password=manager';
+autocommit off;
+prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p1 using 'values(''derby.authentication.provider'', ''LDAP'')';
+
+-- there is no such machine as noSuchMachine and so the authentication will fail
+execute p1 using 'values(''derby.authentication.server'', ''noSuchMachine:389'')';
+execute p1 using 'values(''derby.authentication.ldap.searchBase'', ''o=opensource.apache.com'')';
+-- this is the default search filter
+execute p1 using 'values(''derby.authentication.ldap.searchFilter'', ''(&(objectClass=inetOrgPerson)(uid=%USERNAME%))'')';
+commit;
+autocommit on;
+--
+-- Shutdown the system for database properties to take effect
+--
+disconnect all;
+connect 'ldapSchemeDB;user=system;password=manager;shutdown=true';
+disconnect all;
+
+connect 'ldapSchemeDB;user=mamta;password=yeeHaLdap';
+show connections;
+
+disconnect all;
+
+-- Derby system shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,7 @@
+ij.protocol=jdbc:derby:
+ij.database=jdbc:derby:wombat;create=true;user=system;password=manager
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+
+runwithj9=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,117 @@
+### warning - following contains fictional names only
+
+#
+# secureUsers configuration:
+#
+# Here we configure 5 databases with each of them having a different
+# authentication scheme being set. NT authentication is done through
+# Netscape LDAP NT Synchronization service that basically set-up
+# and synchronize a X500 organization corresponding to the NT domain
+# handled by the PDC (NT Primary Domain Controller).
+#
+# The different authentication schemes we test and provide are:
+#
+#	- None (user is always authenticated successfully)
+#	- BUILTIN (BUILTIN Basic authentication scheme relying on
+#				  users to be defined in derby.user.<userName>
+#				  property).
+#	- LDAP (user to be authenticated against an LDAP server)
+#			NOTE: LDAP scheme is used for NT authentication as well;
+#				  being done thru Netscape directory NT synch service)
+#	- NIS+ (user to be authenticated against a NIS+ server)
+#	- User defined authentication scheme (that implements the authentication
+#	  interface)
+# 
+derby.infolog.append=true
+
+# Turn on authentication at the system level
+derby.connection.requireAuthentication=true
+
+# Trace ON for authentication
+#
+# (tracing appears in derby.log)
+# (if ldap used there is also another file called
+#  DerbyLDAP.out for ldap requests tracing)
+derby.debug.true=AuthenticationTrace
+
+################################################################
+#
+# Default provider if none specified and requireAuthentication
+# set to true.
+#
+# BUILTIN Authentication settings
+#
+# derby.authentication.provider=BUILTIN
+#
+################################################################
+#
+# Users definition for the BUILTIN scheme - Note that this
+# users are defined at the system level. They could be overriden
+# at the database level using setDatabaseProperty() method
+# alias. In a sens the following definitions below will be known
+# by all databases using BUILTIN scheme (unless database has
+# got the 'derby.database.propertiesOnly' set to 'true').
+#
+derby.user.system=manager
+derby.user.Jamie=theHooligan
+derby.user.francois=paceesalute
+derby.user.jeff=homeRun
+derby.user.howardR=takeItEasy
+derby.user.kreg=IwasBornReady
+
+################################################################
+#
+# LDAP Authentication Settings
+#
+# derby.authentication.provider=LDAP
+#
+# derby.authentication.server=localhost:389
+# derby.authentication.server=//localhost:389
+# derby.authentication.server=ldap://localhost:389
+#
+################################################################
+#
+# LDAP search base
+#
+#derby.authentication.ldap.searchBase=o=opensource.apache.com
+
+# LDAP search filters examples
+#
+# [default is: (&((objectClass=inetOrgPerson)(uid=%USERNAME%))) ]
+#
+#derby.authentication.ldap.searchFilter=(&((objectClass=inetOrgPerson)(uid=%USERNAME%)))
+#derby.authentication.ldap.searchFilter=(&((ou=People)(uid=%USERNAME%))
+#derby.authentication.ldap.searchFilter=ou=People
+#derby.authentication.ldap.searchFilter=derby.user
+#
+# Example on how to cache user's full DN in Derby in order
+# to save the ldap initial user dn lookup.
+#
+# Note that if user DN not found/cached in derby.user; then
+# normal userDN lookup with default search filter is applied.
+#
+#derby.user.francois=uid=francois,ou=People,o=opensource.apache.com
+
+################################################################
+#
+# NIS+ Authentication Settings
+#
+# derby.authentication.provider=NIS+
+#
+# derby.authentication.server=thehost/apache.com
+# derby.authentication.server=//thehost/apache.com
+# derby.authentication.server=nisplus://thehost/apache.com
+# derby.authentication.server=nis+://thehost/apache.com
+#
+################################################################
+
+################################################################
+#
+# User provider scheme. See JavaDoc for details.
+#
+#
+# derby.authentication.provider=com.a.valid.classPath.AuthScheme
+#
+################################################################
+#
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers1_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substitut
+en
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+-------------------------------------------------------------------------------
+--
+substitute=(server log.*);(server log XXX)
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,6 @@
+ij.protocol=jdbc:derby:
+ij.database=jdbc:derby:wombat;create=true;user=system;password=manager
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+
+runwithj9=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,118 @@
+### following contains only fictional names for machines and domains
+#
+# secureUsers configuration:
+#
+# Here we configure 5 databases with each of them having a different
+# authentication scheme being set. NT authentication is done through
+# Netscape LDAP NT Synchronization service that basically set-up
+# and synchronize a X500 organization corresponding to the NT domain
+# handled by the PDC (NT Primary Domain Controller).
+#
+# The different authentication schemes we test and provide are:
+#
+#	- None (user is always authenticated successfully)
+#	- DERBY (Derby Basic authentication scheme relying on
+#				  users to be defined in derby.user.<userName>
+#				  property).
+#	- LDAP (user to be authenticated against an LDAP server)
+#			NOTE: LDAP scheme is used for NT authentication as well;
+#				  being done thru Netscape directory NT synch service)
+#	- NIS+ (user to be authenticated against a NIS+ server)
+#	- User defined authentication scheme (that implements the authentication
+#	  interface)
+# 
+derby.infolog.append=true
+
+# Turn on authentication at the system level
+derby.connection.requireAuthentication=true
+
+# Trace ON for authentication
+#
+# (tracing appears in derby.log)
+# (if ldap used there is also another file called
+#  DerbyLDAP.out for ldap requests tracing)
+derby.debug.true=AuthenticationTrace
+
+################################################################
+#
+# Default provider if none specified and requireAuthentication
+# set to true.
+#
+# BUILTIN Authentication settings
+#
+# derby.authentication.provider=BUILTIN
+#
+################################################################
+#
+# Users definition for the BUILTIN scheme - Note that this
+# users are defined at the system level. They could be overriden
+# at the database level using setDatabaseProperty() method
+# alias. In a sens the following definitions below will be known
+# by all databases using BUILTIN scheme (unless database has
+# got the 'derby.database.propertiesOnly' set to 'true').
+#
+derby.user.system=manager
+derby.user.Jamie=theHooligan
+derby.user.francois=paceesalute
+derby.user.jeff=homeRun
+derby.user.howardR=takeItEasy
+derby.user.kreg=IwasBornReady
+
+################################################################
+#
+# LDAP Authentication Settings
+#
+# derby.authentication.provider=LDAP
+#
+# derby.authentication.server=localhost:389
+# derby.authentication.server=//localhost:389
+# derby.authentication.server=ldap://localhost:389
+#
+################################################################
+#
+# LDAP search base
+#
+# note: example syntax only; no actual machine/url
+#derby.authentication.ldap.searchBase=o=opensource.apache.com
+
+# LDAP search filters examples
+#
+# [default is: (&((objectClass=inetOrgPerson)(uid=%USERNAME%))) ]
+#
+#derby.authentication.ldap.searchFilter=(&((objectClass=inetOrgPerson)(uid=%USERNAME%)))
+#derby.authentication.ldap.searchFilter=(&((ou=People)(uid=%USERNAME%))
+#derby.authentication.ldap.searchFilter=ou=People
+#derby.authentication.ldap.searchFilter=derby.user
+#
+# Example on how to cache user's full DN in Derby in order
+# to save the ldap initial user dn lookup.
+#
+# Note that if user DN not found/cached in derby.user; then
+# normal userDN lookup with default search filter is applied.
+#
+# note: following is example syntax only; no actual machine/url
+#derby.user.francois=uid=francois,ou=People,o=opensource.apache.com
+
+################################################################
+#
+# NIS+ Authentication Settings
+#
+# derby.authentication.provider=NIS+
+#
+# derby.authentication.server=thehost/apache.com
+# derby.authentication.server=//thehost/apache.com
+# derby.authentication.server=nisplus://thehost/apache.com
+# derby.authentication.server=nis+://thehost/apache.com
+#
+################################################################
+
+################################################################
+#
+# Special/User provider scheme. See JavaDoc for details.
+#
+# Special Authentication settings
+#
+# derby.authentication.provider=com.a.valid.classPath.AuthScheme
+#
+################################################################
+#

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/secureUsers_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substitut
+en
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+-------------------------------------------------------------------------------
+--
+substitute=(server log.*);(server log XXX)
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/short.txt
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/short.txt?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/short.txt	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+test data: a string column inserted as an Ascii stream

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc20.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,208 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.statementJdbc20
+
+   Copyright 2000, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test of additional methods in JDBC2.0  methods in statement and 
+ * resultset classes.
+ *
+ */
+
+public class statementJdbc20 { 
+    
+	public static void main(String[] args) {
+		Connection con;
+		ResultSet rs;
+		Statement stmt;
+
+		System.out.println("Test statementJdbc20 starting");
+
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+
+
+			stmt = con.createStatement();
+
+            //create a table, insert a row, do a select from the table,
+			stmt.execute("create table tab1 (i int, s smallint, r real)");
+            stmt.executeUpdate("insert into tab1 values(1, 2, 3.1)");
+
+            // set all the peformance hint parameters
+            stmt.setFetchSize(25);
+            stmt.setFetchDirection(ResultSet.FETCH_REVERSE);
+            stmt.setEscapeProcessing(true);
+
+           //Error  testing  : set wrong values ..
+           try{
+              stmt.setFetchSize(-1000);
+           } 
+           catch(SQLException e){
+              dumpExpectedSQLExceptions(e);
+           }
+
+           try{
+              stmt.setFetchDirection(-1000);
+           } 
+           catch(SQLException e){
+              dumpExpectedSQLExceptions(e);
+           }
+            
+
+            System.out.println("Fetch Size "  + stmt.getFetchSize());
+            System.out.println("Fetch Direction " + stmt.getFetchDirection());
+
+            // read the data just for the heck of it 
+			rs = stmt.executeQuery("select * from tab1");
+            while (rs.next())
+            {
+               System.out.println(rs.getInt(1) + " " + rs.getShort(2) + 
+                                   " " + rs.getFloat(3));
+            }
+
+            // Get the constatnts for a result set            
+            System.out.println("Result Set Fetch Size "  + rs.getFetchSize());
+            System.out.println("Result Set Fetch Direction " + rs.getFetchDirection());
+
+           // change values local to result set and get them back
+            rs.setFetchSize(250);
+            try{
+               rs.setFetchDirection(ResultSet.FETCH_FORWARD);
+            }catch(SQLException e){
+              dumpExpectedSQLExceptions(e);
+            }
+
+            System.out.println("Result Set Fetch Size "  + rs.getFetchSize());
+            System.out.println("Result Set Fetch Direction " + rs.getFetchDirection());
+
+          // exception conditions 
+            stmt.setMaxRows(10);
+           try{
+              rs.setFetchSize(100);
+           } 
+           catch(SQLException e){
+              dumpExpectedSQLExceptions(e);
+           }
+
+           //Error  testing  : set wrong values ..
+           try{
+              rs.setFetchSize(-2000);
+           } 
+           catch(SQLException e){
+              dumpExpectedSQLExceptions(e);
+           }
+
+           try{
+              rs.setFetchDirection(-2000);
+           } 
+           catch(SQLException e){
+              dumpExpectedSQLExceptions(e);
+           }
+
+           // set the fetch size values to zero .. to ensure 
+           // error condtions are correct !
+
+            rs.setFetchSize(0);
+            stmt.setFetchSize(0);
+       
+			rs.close();
+
+			//RESOLVE - uncomment tests in 3.5
+			// executeQuery() not allowed on statements
+			// that return a row count
+			try
+			{
+				stmt.executeQuery("create table trash(c1 int)");
+			}
+			catch (SQLException e)
+			{
+              dumpExpectedSQLExceptions(e);
+			}
+
+			// verify that table was not created
+			try
+			{
+				rs = stmt.executeQuery("select * from trash");
+				System.out.println("select from trash expected to fail");
+			}
+			catch (SQLException e)
+			{
+              dumpExpectedSQLExceptions(e);
+			}
+
+			// executeUpdate() not allowed on statements
+			// that return a ResultSet
+			try
+			{
+				stmt.executeUpdate("values 1");
+			}
+			catch (SQLException e)
+			{
+              dumpExpectedSQLExceptions(e);
+			}
+
+			stmt.close();
+			con.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test statementJdbc20 finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+		}
+	}
+
+	static private void dumpExpectedSQLExceptions (SQLException se) {
+		System.out.println("PASS -- expected exception");
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+        }
+    }
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/statementJdbc30.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,136 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.statementJdbc30
+
+   Copyright 2001, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
+/**
+ * Test of additional methods in JDBC3.0  methods in statement class.
+ *
+ */
+
+public class statementJdbc30 { 
+
+	public static void main(String[] args) {
+		Connection con;
+		ResultSet rs;
+		Statement stmt;
+
+		System.out.println("Test statementJdbc30 starting");
+
+		try
+		{
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			con = ij.startJBMS();
+
+
+			stmt = con.createStatement();
+
+			//create a table, insert a row, do a select from the table,
+			stmt.execute("create table tab1 (i int, s smallint, r real)");
+			stmt.executeUpdate("insert into tab1 values(1, 2, 3.1)");
+
+			// read the data just for the heck of it
+			rs = stmt.executeQuery("select * from tab1");
+			rs.next();
+
+      System.out.println("trying stmt.getMoreResults(int) :");
+			stmt.getMoreResults(JDBC30Translation.CLOSE_CURRENT_RESULT);
+
+			System.out.println("trying stmt.executeUpdate(String, int) :");
+			stmt.executeUpdate("insert into tab1 values(2, 3, 4.1)", JDBC30Translation.NO_GENERATED_KEYS);
+
+			System.out.println("trying stmt.executeUpdate(String, int[]) :");
+			int[] columnIndexes = new int[2];
+			columnIndexes[0] = 1;
+			columnIndexes[1] = 2;
+			try {
+				stmt.executeUpdate("insert into tab1 values(2, 3, 4.1)", columnIndexes);
+			} catch (SQLException ex) {
+				dumpExpectedSQLExceptions(ex);
+			}
+
+			System.out.println("trying stmt.executeUpdate(String, String[]) :");
+			String[] columnNames = new String[2];
+			columnNames[0] = "I";
+			columnNames[1] = "S";
+			try {
+				stmt.executeUpdate("insert into tab1 values(2, 3, 4.1)", columnNames);
+			} catch (SQLException ex) {
+				dumpExpectedSQLExceptions(ex);
+			}
+
+			System.out.println("trying stmt.execute(String, int) :");
+			stmt.execute("select * from tab1", JDBC30Translation.NO_GENERATED_KEYS);
+
+			System.out.println("trying stmt.execute(String, int[]) :");
+			try {
+				stmt.execute("insert into tab1 values(2, 3, 4.1)", columnIndexes);
+			} catch (SQLException ex) {
+				dumpExpectedSQLExceptions(ex);
+			}
+
+			System.out.println("trying stmt.execute(String, String[]) :");
+			try {
+				stmt.execute("insert into tab1 values(2, 3, 4.1)", columnNames);
+			} catch (SQLException ex) {
+				dumpExpectedSQLExceptions(ex);
+			}
+
+			System.out.println("trying stmt.getResultSetHoldability() :");
+			stmt.getResultSetHoldability();
+
+			System.out.println("trying stmt.getGeneratedKeys() :");
+			stmt.getGeneratedKeys();
+
+			rs.close();
+			stmt.close();
+			con.close();
+
+		}
+		catch (SQLException e) {
+			System.out.println("Expected : " + e.getMessage());
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test statementJdbc30 finished");
+    }
+
+	public static void dumpExpectedSQLExceptions (SQLException se) {
+		System.out.println("PASS -- expected exception");
+		while (se != null)
+		{
+			System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
+			se = se.getNextException();
+        }
+    }
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,90 @@
+--
+connect 'wombat;create=true;user=dan;password=MakeItFaster';
+autocommit off;
+prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p1 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+execute p1 using 'values(''derby.database.fullAccessUsers'', ''francois,jeff,howardR,ames,kreg'')';
+remove p1;
+commit;
+autocommit on;
+disconnect;
+
+connect 'wombat;shutdown=true;user=francois;password=paceesalute';
+connect 'myDB;create=true;user=dan;password=MakeItFaster';
+autocommit off;
+prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p2 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+execute p2 using 'values(''derby.database.fullAccessUsers'', ''jerry,kreg,dan,jamie,ames,francois'')';
+remove p2;
+commit;
+autocommit on;
+disconnect;
+connect 'myDB;shutdown=true;user=dan;password=MakeItFaster';
+
+-- beetle 5468
+disconnect all;
+
+-- Specifically test JBMS users.
+--
+-- check allowed users in wombat db.
+connect 'wombat;user=kreg;password=visualWhat?';
+connect 'wombat;user=jeff;password=HomeRun61';
+connect 'wombat;user=ames;password=AnyVolunteer?';
+connect 'wombat;user=howardR;password=IamBetterAtTennis';
+connect 'wombat;user=francois;password=paceesalute';
+show connections;
+disconnect all;
+-- check allowed users in myDB db.
+-- also check USER flavors
+connect 'myDB;user=jerry;password=SacreBleu';
+create table APP.t1(c1 char(30) check (UPPER(c1) <> 'JAMIE'));
+insert into APP.t1 values CURRENT_USER;
+connect 'myDB;user=kreg;password=visualWhat?';
+insert into APP.t1 values USER;
+connect 'myDB;user=ames;password=AnyVolunteer?';
+insert into APP.t1 values SESSION_USER;
+connect 'myDB;user=dan;password=MakeItFaster';
+select * from APP.t1;
+update APP.t1 set c1 = {fn user() };
+select * from APP.t1;
+connect 'myDB;user=francois;password=paceesalute';
+update APP.t1 set c1 = USER;
+connect 'myDB;user=jamie;password=MrNamePlates';
+select * from APP.t1;
+update APP.t1 set c1 = USER;
+show connections;
+disconnect all;
+--
+-- some negative cases
+--
+-- Invalid login's
+connect 'wombat';
+connect 'wombat;user=badUser1;password=YeeHa!';
+connect 'wombat;user=badUser2;password=YeeHa!';
+connect 'myDB;user=dan;password=MakeItSlower';
+connect 'myDB;user=jamie;password=LetMeIn';
+connect 'wombat;user=francois;password=Corsica';
+-- Invalid database users
+connect 'myDB;user=howardR;password=IamBetterAtTennis';
+connect 'wombat;user=jerry;password=SacreBleu';
+connect 'wombat;user=jamie;password=MrNamePlates';
+show connections;
+connect 'wombat;user=francois;password=paceesalute';
+connect 'myDB;user=jerry;password=SacreBleu';
+-- Database shutdown - check user - should fail
+connect 'myDB;shutdown=true';
+connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
+connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
+show connections;
+-- Database shutdown - check user - should succeed
+-- beetle 5367
+connect 'wombat;user=francois;password=paceesalute;shutdown=true';
+connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
+show connections;
+-- JBMS System shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+disconnect all;
+-- JBMS System shutdown - check user - should succeed
+connect ';user=francois;password=paceesalute;shutdown=true';
+-- beetle 5390
+-- the server does not shut down properly in network server

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,186 @@
+--
+-- Specifically test Derby users using DERBY scheme
+-- and by only looking at database properties for authentication
+-- The only user at the system level is system/manager
+--
+
+-- check allowed users in wombat db.
+-- initial connection in sysprop was:
+-- connect 'wombat;create=true;user=system;password=manager';
+--
+-- Default to: derby.authentication.provider=BUILTIN
+--
+autocommit off;
+prepare p1 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p1 using 'values(''derby.connection.requireAuthentication'', ''true'')';
+commit;
+remove p1;
+autocommit on;
+
+disconnect all;
+connect 'wombat;shutdown=true;user=system;password=manager';
+
+-- beetle 5468
+disconnect all;
+
+connect 'wombat;user=system;password=manager';
+
+--
+-- set authentication config for 'wombat' database
+--
+autocommit off;
+prepare p2 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p2 using 'values(''derby.user.kreg'', ''visualWhat?'')';
+execute p2 using 'values(''derby.user.jeff'', ''HomeRun61'')';
+execute p2 using 'values(''derby.user.ames'', ''AnyVolunteer?'')';
+execute p2 using 'values(''derby.user.jamie'', ''MrNamePlates'')';
+execute p2 using 'values(''derby.user.howardR'', ''IamBetterAtTennis'')';
+execute p2 using 'values(''derby.user.francois'', ''paceesalute'')';
+execute p2 using 'values(''derby.database.fullAccessUsers'', ''jeff,howardR,ames,francois,kreg'')';
+execute p2 using 'values(''derby.database.readOnlyAccessUsers'', ''jamie'')';
+execute p2 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+execute p2 using 'values(''derby.database.propertiesOnly'', ''true'')';
+commit;
+autocommit on;
+
+-- Check that the passwords are encrypted
+-- values getDatabaseProperty('derby.user.francois');
+-- values getDatabaseProperty('derby.user.ames');
+-- values getDatabaseProperty('derby.user.kreg');
+-- values getDatabaseProperty('derby.user.jeff');
+-- values getDatabaseProperty('derby.user.howardR');
+-- values getDatabaseProperty('derby.user.jamie');
+
+connect 'wombat;user=kreg;password=visualWhat?';
+connect 'wombat;user=jeff;password=HomeRun61';
+connect 'wombat;user=ames;password=AnyVolunteer?';
+connect 'wombat;user=howardR;password=IamBetterAtTennis';
+-- should succeed
+create table APP.t1(c1 char(30));
+insert into APP.t1 values CURRENT_USER;
+
+connect 'wombat;user=jamie;password=MrNamePlates';
+-- should fail as readOnly user
+insert into APP.t1 values CURRENT_USER;
+create table APP.t2(c1 char(30));
+
+show connections;
+
+disconnect all;
+
+-- check allowed users in myDB db.
+--
+connect 'myDB;create=true;user=system;password=manager';
+autocommit off;
+prepare p3 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p3 using 'values(''derby.connection.requireAuthentication'', ''true'')';
+remove p3;
+autocommit on;
+disconnect all;
+connect 'myDB;shutdown=true;user=system;password=manager';
+
+-- beetle 5468
+disconnect all;
+
+connect 'myDB;user=system;password=manager';
+
+--
+-- set authentication config for 'myDB' database
+--
+autocommit off;
+prepare p4 as 'CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(?,?)';
+execute p4 using 'values(''derby.user.kreg'', ''visualWhat?'')';
+execute p4 using 'values(''derby.user.dan'', ''MakeItFaster'')';
+execute p4 using 'values(''derby.user.ames'', ''AnyVolunteer?'')';
+execute p4 using 'values(''derby.user.jerry'', ''SacreBleu'')';
+execute p4 using 'values(''derby.user.jamie'', ''MrNamePlates'')';
+execute p4 using 'values(''derby.user.francois'', ''paceesalute'')';
+execute p4 using 'values(''derby.database.fullAccessUsers'', ''jerry,dan,kreg,ames,francois,jamie'')';
+execute p4 using 'values(''derby.database.defaultConnectionMode'', ''noAccess'')';
+execute p4 using 'values(''derby.database.propertiesOnly'', ''true'')';
+commit;
+autocommit on;
+
+-- Check that the passwords are encrypted
+-- values getDatabaseProperty('derby.user.francois');
+-- values getDatabaseProperty('derby.user.ames');
+-- values getDatabaseProperty('derby.user.kreg');
+-- values getDatabaseProperty('derby.user.dan');
+-- values getDatabaseProperty('derby.user.jerry');
+-- values getDatabaseProperty('derby.user.jamie');
+
+--
+-- also check USER flavors
+--
+connect 'myDB;user=jerry;password=SacreBleu';
+create table APP.t1(c1 char(30) check (UPPER(c1) <> 'JAMIE'));
+insert into APP.t1 values CURRENT_USER;
+connect 'myDB;user=kreg;password=visualWhat?';
+insert into APP.t1 values USER;
+connect 'myDB;user=ames;password=AnyVolunteer?';
+insert into APP.t1 values SESSION_USER;
+connect 'myDB;user=dan;password=MakeItFaster';
+select * from APP.t1;
+update APP.t1 set c1 = USER;
+select * from APP.t1;
+connect 'myDB;user=francois;password=paceesalute';
+update APP.t1 set c1 = USER;
+connect 'myDB;user=jamie;password=MrNamePlates';
+select * from APP.t1;
+update APP.t1 set c1 = USER;
+
+show connections;
+
+disconnect all;
+
+--
+-- some negative cases
+--
+
+-- Invalid login's
+connect 'wombat';
+connect 'wombat;user=badUser1;password=YeeHa!';
+connect 'wombat;user=badUser2;password=YeeHa!';
+connect 'myDB;user=dan;password=MakeItSlower';
+connect 'myDB;user=jamie;password=LetMeIn';
+connect 'wombat;user=francois;password=Corsica';
+
+-- Invalid database users
+connect 'myDB;user=howardR;password=IamBetterAtTennis';
+connect 'wombat;user=jerry;password=SacreBleu';
+connect 'wombat;user=jamie;password=MrNamePlates';
+
+show connections;
+
+connect 'wombat;user=francois;password=paceesalute';
+connect 'myDB;user=jerry;password=SacreBleu';
+
+-- Database shutdown - check user - should fail
+connect 'myDB;shutdown=true';
+connect 'myDB;user=jamie;password=LetMeIn;shutdown=true';
+connect 'wombat;user=jerry;password=SacreBleu;shutdown=true';
+
+show connections;
+disconnect all;
+show connections;
+
+-- Database shutdown - check user - should succeed
+connect 'wombat;user=francois;password=paceesalute;shutdown=true';
+
+-- beetle 5468
+disconnect all;
+
+connect 'myDB;user=jerry;password=SacreBleu;shutdown=true';
+
+-- beetle 5468
+disconnect all;
+
+-- there should be no connections left here
+show connections;
+
+-- JBMS System shutdown - check user - should fail
+connect ';user=jamie;password=LetMeIn;shutdown=true';
+
+-- JBMS System shutdown - check user - should succeed
+connect ';user=system;password=manager;shutdown=true';
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,5 @@
+ij.protocol=jdbc:derby:
+ij.database=jdbc:derby:wombat;create=true;user=system;password=manager
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,24 @@
+#
+# This properties file is for the 'users' test.
+# 
+# This file is expected to be placed into $WS/systest/out by
+# the run script, and expects to be run in an environment where
+# the property derby.system.home points to $WS/systest/out.
+#
+derby.infolog.append=true
+derby.connection.requireAuthentication=true
+# we use the old 1.5 Basic user authentication scheme, now a specialized scheme.
+derby.debug.true=AuthenticationTrace
+
+#
+# we only define system user (at the system level)
+#
+derby.user.system=manager
+
+# Database users restriction lists - DEPRECATED Properties
+# Use derby.database.{fullAccessUsers,
+#						   readOnlyAccessUsers,
+#						   defaultConnectionMode} properties only.
+#
+derby.database.users.wombat=francois,jeff,howardR,ames,kreg
+derby.database.users.myDB=jerry,kreg,dan,jamie,ames,francois

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users2_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substitut
+en
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+-------------------------------------------------------------------------------
+--
+substitute=(server log.*);(server log XXX)
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,5 @@
+ij.protocol=jdbc:derby:
+ij.database=jdbc:derby:wombat;create=true;user=francois;password=paceesalute
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,27 @@
+#
+# This properties file is for the 'users' test.
+# 
+# This file is expected to be placed into $WS/systest/out by
+# the run script, and expects to be run in an environment where
+# the property derby.system.home points to $WS/systest/out.
+#
+derby.infolog.append=true
+derby.connection.requireAuthentication=true
+derby.authentication.provider=BUILTIN
+derby.debug.true=AuthenticationTrace
+
+#
+# Users definition
+#
+derby.user.dan=MakeItFaster
+derby.user.kreg=visualWhat?
+derby.user.jeff=HomeRun61
+derby.user.ames=AnyVolunteer?
+derby.user.jerry=SacreBleu
+derby.user.howardR=IamBetterAtTennis
+derby.user.francois=paceesalute
+derby.user.jamie=MrNamePlates
+
+# Database users restriction lists
+#derby.database.users.wombat=francois,jeff,howardR,ames,kreg
+#derby.database.users.myDB=jerry,kreg,dan,jamie,ames,francois

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/users_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substitut
+en
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+-------------------------------------------------------------------------------
+--
+substitute=(server log.*);(server log XXX)
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaJNDI.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaJNDI.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaJNDI.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,71 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.jdbcapi.xaJNDI
+
+   Copyright 2000, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+import org.apache.derby.jdbc.EmbeddedDataSource;
+import org.apache.derby.jdbc.EmbeddedXADataSource;
+
+import java.util.Hashtable;
+
+import javax.naming.*;
+import javax.naming.directory.*;
+
+//The test compares the xa data source which is bound to jndi
+//with the xa data source which is returned from the jndi lookup.
+public class xaJNDI
+{ 
+	public static void main(String[] args)
+	{
+		try
+		{
+			Hashtable env = new Hashtable();
+			env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
+			// using a fictional name - host and port & url will have to be 
+			// modified to use a real ldap server machine & port & url
+			env.put(Context.PROVIDER_URL, "ldap://thehost.opensource.apache.com:389");
+			env.put(Context.SECURITY_AUTHENTICATION, "simple");
+			InitialDirContext ic = new InitialDirContext(env);
+
+			EmbeddedXADataSource rxads =  new EmbeddedXADataSource();
+			rxads.setDatabaseName("rxads");
+			rxads.setCreateDatabase("create");
+			rxads.setDescription("XA DataSource");
+			ic.rebind("cn=compareDS, o=opensource.apache.com",rxads);
+      javax.sql.XADataSource ads =
+      (javax.sql.XADataSource)ic.lookup("cn=compareDS, o=opensource.apache.com");
+      if (rxads.equals(ads))
+        System.out.println("SUCCESS:The 2 data sources are same");
+      else
+	      System.out.println("FAILURE:The 2 data sources should be same");
+
+  		rxads.setCreateDatabase("");
+      if (rxads.equals(ads))
+        System.out.println("FAILURE:The 2 data sources should be different");
+      else
+	      System.out.println("SUCCESS:The 2 data sources are different");
+
+		} catch (Exception e) {
+			e.printStackTrace();
+			System.out.println("caught " + e);
+		}
+	}
+
+}

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/altertable.sql	Tue Jan 11 11:53:57 2005
@@ -120,7 +120,7 @@
 
 create function countopens() returns varchar(128)
 language java parameter style java
-external name 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.countOpens';
+external name 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.countOpens';
 commit;
 
 -- do consistency check on scans, etc.
@@ -409,7 +409,7 @@
 execute p1;
 
 -- do consistency check on scans, etc.
--- values (org.apache.derbyTesting.functionTests.util.ConsistencyChecker::countOpens());
+-- values (org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker::countOpens());
 
 -- verify the consistency of the indexes on the system catalogs
 select tablename, SYSCS_UTIL.SYSCS_CHECK_TABLE('SYS', tablename)

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml	Tue Jan 11 11:53:57 2005
@@ -68,6 +68,7 @@
       <include name="${this.dir}/*.java"/>
       <exclude name="${this.dir}/declareGlobalTempTableJavaJDBC30.java"/>
       <exclude name="${this.dir}/holdCursorJavaReflection.java"/>
+      <exclude name="${this.dir}/holdCursorJava.java"/>
       <exclude name="${this.dir}/streams.java"/>
       <exclude name="${this.dir}/procedureJdbc30.java"/>
     </javac>
@@ -89,6 +90,7 @@
       </classpath>
       <exclude name="${this.dir}/declareGlobalTempTableJavaJDBC30.java"/>
       <include name="${this.dir}/holdCursorJavaReflection.java"/>
+      <include name="${this.dir}/holdCursorJava.java"/>
       <include name="${this.dir}/streams.java"/>
       <include name="${this.dir}/procedureJdbc30.java"/>
     </javac>

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql	Tue Jan 11 11:53:57 2005
@@ -4,7 +4,7 @@
 run resource 'createTestProcedures.subsql';
 maximumdisplaywidth 512;
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant	Tue Jan 11 11:53:57 2005
@@ -82,6 +82,7 @@
 functions.sql
 groupBy.sql
 holdCursorJavaReflection_app.properties
+holdCursorJava_app.properties
 holdCursorIJ.sql
 holdCursorIJ_app.properties
 identifier.sql
@@ -152,6 +153,8 @@
 repeat_app.properties
 repeat_derby.properties
 schemas.sql
+scrollCursors1.sql
+scrollCursors3.sql
 select.sql
 selectivity.sql
 selectivity_app.properties

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,192 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.lang.holdCursorJava
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.lang;
+
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test hold cursor after commit
+ */
+public class holdCursorJava {
+
+  public static void main (String args[])
+  {
+    try {
+		/* Load the JDBC Driver class */
+		// use the ij utility to read the property file and
+		// make the initial connection.
+		ij.getPropertyArg(args);
+		Connection conn = ij.startJBMS();
+
+		createAndPopulateTable(conn);
+
+    //set autocommit to off after creating table and inserting data
+    conn.setAutoCommit(false);
+		testHoldCursorOnMultiTableQuery(conn);
+		testIsolationLevelChange(conn);
+
+		conn.close();
+    } catch (Exception e) {
+		System.out.println("FAIL -- unexpected exception "+e);
+		JDBCDisplayUtil.ShowException(System.out, e);
+		e.printStackTrace();
+    }
+  }
+
+  //create table and insert couple of rows
+  private static void createAndPopulateTable(Connection conn) throws SQLException {
+    Statement stmt = conn.createStatement();
+
+    System.out.println("Creating table...");
+    stmt.executeUpdate( "CREATE TABLE T1 (c11 int, c12 int)" );
+    stmt.executeUpdate("INSERT INTO T1 VALUES(1,1)");
+    stmt.executeUpdate("INSERT INTO T1 VALUES(2,1)");
+    stmt.executeUpdate( "CREATE TABLE T2 (c21 int, c22 int)" );
+    stmt.executeUpdate("INSERT INTO T2 VALUES(1,1)");
+    stmt.executeUpdate("INSERT INTO T2 VALUES(1,2)");
+    stmt.executeUpdate("INSERT INTO T2 VALUES(1,3)");
+    System.out.println("done creating table and inserting data.");
+
+    stmt.close();
+  }
+
+  //test cursor holdability after commit on multi table query
+  private static void testHoldCursorOnMultiTableQuery(Connection conn) throws Exception
+  {
+    Statement	s;
+    ResultSet			rs;
+
+    System.out.println("Start multi table query with holdability true test");
+    s = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
+    ResultSet.HOLD_CURSORS_OVER_COMMIT );
+
+    //open a cursor with multiple rows resultset
+    rs = s.executeQuery("select t1.c11, t2.c22 from t1, t2 where t1.c11=t2.c21");
+    rs.next();
+    System.out.println("value of t2.c22 is " + rs.getString(2));
+    conn.commit();
+    rs.next(); //because holdability is true, should be able to navigate the cursor after commit
+    System.out.println("value of t2.c22 is " + rs.getString(2));
+    rs.close();
+    System.out.println("Multi table query with holdability true test over");
+  }
+
+  //test cursor holdability after commit
+  private static void testIsolationLevelChange(Connection conn) throws Exception
+  {
+    Statement	s;
+    ResultSet			rs;
+
+    System.out.println("Start isolation level change test");
+    //set current isolation to read committed
+    conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+
+    s = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
+    ResultSet.HOLD_CURSORS_OVER_COMMIT );
+
+    //open a cursor with multiple rows resultset
+    rs = s.executeQuery("select * from t1");
+    rs.next();
+
+    //Changing to different isolation from the current isolation for connection
+    //will give an exception because there are held cursors
+		try {
+			System.out.println("Switch isolation while there are open cursors");
+			conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+		} catch (SQLException se) {
+
+			System.out.println("Should see exceptions");
+			String m = se.getSQLState();
+			JDBCDisplayUtil.ShowSQLException(System.out,se);
+
+			if ("X0X03".equals(m)) {
+				System.out.println("PASS: Can't change isolation if they are open cursor");
+			} else {
+				System.out.println("FAIL: Shouldn't able to change isolation because there are open cursor");
+			}
+		}
+
+    //Close open cursors and then try changing to different isolation.
+    //It should work.
+    rs.close();
+    conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+
+	// set the default holdability for the Connection and try setting the isolation level
+
+
+		conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
+
+    conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+	conn.createStatement().executeUpdate("SET ISOLATION RS");
+
+		// test for bug4385 - internal ResultSets were being re-used incorrectly
+		// will occur in with JDBC 2.0,1.2 but the first statement I found that
+		// failed was an insert with generated keys.
+		conn.createStatement().executeUpdate("Create table bug4385 (i int not null primary key, c int generated always as identity)");
+		conn.commit();
+
+		PreparedStatement ps = conn.prepareStatement("insert into bug4385(i) values(?)", Statement.RETURN_GENERATED_KEYS);
+
+		ps.setInt(1, 199);
+		ps.executeUpdate();
+
+		rs = ps.getGeneratedKeys();
+		int count = 0;
+		while (rs.next()) {
+			rs.getInt(1);
+			count++;
+		}
+		rs.close();
+		if (count != 1)
+			System.out.println("FAIL returned more than one row for generated keys");
+
+		ps.setInt(1, 299);
+		ps.executeUpdate();
+		rs = ps.getGeneratedKeys();
+		count = 0;
+		while (rs.next()) {
+			rs.getInt(1);
+			count++;
+		}
+		if (count != 1)
+			System.out.println("FAIL returned more than one row for generated keys on re-execution");
+		rs.close();
+		ps.close();
+		conn.rollback();
+
+    //switch back to default isolation & holdability
+		conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
+
+    System.out.println("Isolation level change test over");
+	conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+  }
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorJava_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+database=jdbc:derby:wombat;create=true
+protocol=jdbc:derby:
+ij.protocol=jdbc:derby:
+derby.optimizer.noTimeout=true
+
+ij.defaultResourcePackage=/org/apache/derbyTesting/functionTests/tests/lang/
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+
+runwithj9=false
+runwithjdk13=false
+runwithibm13=false

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql	Tue Jan 11 11:53:57 2005
@@ -8,7 +8,7 @@
 set isolation to rr;
 
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 autocommit off;
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/openScans.sql	Tue Jan 11 11:53:57 2005
@@ -1,6 +1,6 @@
 -- minimal testing to verify no scans left open
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 autocommit off;
 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/procedureJdbc30.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,251 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.lang.procedureJdbc30
+
+   Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.lang;
+import java.sql.*;
+
+import org.apache.derby.tools.ij;
+import java.io.PrintStream;
+import java.math.BigInteger;
+import java.math.BigDecimal;
+
+import org.apache.derbyTesting.functionTests.tests.jdbcapi.parameterMetaDataJdbc30;
+
+public class procedureJdbc30
+{ 
+
+	static private boolean isDerbyNet = false;
+
+	public static void main (String[] argv) throws Throwable
+	{
+   		ij.getPropertyArg(argv); 
+        Connection conn = ij.startJBMS();
+
+		String framework = System.getProperty("framework");
+		if (framework != null && framework.toUpperCase().equals("DERBYNET"))
+			isDerbyNet = true;
+
+        runTests( conn);
+    }
+
+    public static void runTests( Connection conn) throws Throwable
+    {
+		try {
+			testMoreResults(conn);
+		} catch (SQLException sqle) {
+			org.apache.derby.tools.JDBCDisplayUtil.ShowSQLException(System.out, sqle);
+			sqle.printStackTrace(System.out);
+		}
+		
+	}
+
+	private static void testMoreResults(Connection conn) throws SQLException {
+
+		Statement s = conn.createStatement();
+
+		s.executeUpdate("create table MRS.FIVERS(i integer)");
+		PreparedStatement ps = conn.prepareStatement("insert into MRS.FIVERS values (?)");
+		for (int i = 1; i <= 20; i++) {
+			ps.setInt(1, i);
+			ps.executeUpdate();
+		}
+		ps.close();
+
+		// create a procedure that returns 5 result sets.
+			
+		s.executeUpdate("create procedure MRS.FIVEJP() parameter style JAVA READS SQL DATA dynamic result sets 5 language java external name 'org.apache.derbyTesting.functionTests.util.ProcedureTest.fivejp'");
+
+
+		CallableStatement cs = conn.prepareCall("CALL MRS.FIVEJP()");
+		ResultSet[] allRS = new ResultSet[5];
+
+		// execute the procedure that returns 5 result sets and then use the various
+		// options of getMoreResults().
+
+
+
+
+		System.out.println("\n\nFetching result sets with getMoreResults()");
+		int pass = 0;
+		cs.execute();
+		do {
+
+			allRS[pass++] = cs.getResultSet();
+			System.out.println("  PASS " + pass + " got result set " + (allRS[pass -1] != null));
+			// expect everything except the current result set to be closed.
+			showResultSetStatus(allRS);
+
+		} while (cs.getMoreResults());
+		// check last one got closed
+		showResultSetStatus(allRS);
+		java.util.Arrays.fill(allRS, null);
+
+		System.out.println("\n\nFetching result sets with getMoreResults(Statement.CLOSE_CURRENT_RESULT)");
+		pass = 0;
+		cs.execute();
+		do {
+
+			allRS[pass++] = cs.getResultSet();
+			System.out.println("  PASS " + pass + " got result set " + (allRS[pass -1] != null));
+			// expect everything except the current result set to be closed.
+			showResultSetStatus(allRS);
+
+		} while (cs.getMoreResults(Statement.CLOSE_CURRENT_RESULT));
+		// check last one got closed
+		showResultSetStatus(allRS);
+		java.util.Arrays.fill(allRS, null);
+
+		System.out.println("\n\nFetching result sets with getMoreResults(Statement.CLOSE_ALL_RESULTS)");
+		pass = 0; 
+		cs.execute();
+		do {
+
+			allRS[pass++] = cs.getResultSet();
+			System.out.println("  PASS " + pass + " got result set " + (allRS[pass -1] != null));
+			// expect everything except the current result set to be closed.
+			showResultSetStatus(allRS);
+
+		} while (cs.getMoreResults(Statement.CLOSE_ALL_RESULTS));
+		// check last one got closed
+		showResultSetStatus(allRS);
+		java.util.Arrays.fill(allRS, null);
+
+		System.out.println("\n\nFetching result sets with getMoreResults(Statement.KEEP_CURRENT_RESULT)");
+		pass = 0;
+		cs.execute();
+		do {
+
+			allRS[pass++] = cs.getResultSet();
+			System.out.println("  PASS " + pass + " got result set " + (allRS[pass -1] != null));
+			// expect everything to stay open.
+			showResultSetStatus(allRS);
+
+		} while (cs.getMoreResults(Statement.KEEP_CURRENT_RESULT));
+		// All should still be open.
+		showResultSetStatus(allRS);
+		// now close them all.
+		for (int i = 0; i < allRS.length; i++) {
+			allRS[i].close();
+		}
+		java.util.Arrays.fill(allRS, null);
+
+		System.out.println("\n\nFetching result sets with getMoreResults(<mixture>)");
+		cs.execute();
+
+		System.out.println(" first two with KEEP_CURRENT_RESULT");
+		allRS[0] = cs.getResultSet();
+		boolean moreRS = cs.getMoreResults(Statement.KEEP_CURRENT_RESULT);
+		if (!moreRS)
+			System.out.println("FAIL - no second result set");
+		allRS[1] = cs.getResultSet();
+		// two open
+		showResultSetStatus(allRS);
+		
+		System.out.println(" third with CLOSE_CURRENT_RESULT");
+		moreRS = cs.getMoreResults(Statement.CLOSE_CURRENT_RESULT);
+		if (!moreRS)
+			System.out.println("FAIL - no third result set");
+		allRS[2] = cs.getResultSet();
+		// first and third open, second closed
+		showResultSetStatus(allRS);
+
+		
+		System.out.println(" fourth with KEEP_CURRENT_RESULT");
+		moreRS = cs.getMoreResults(Statement.KEEP_CURRENT_RESULT);
+		if (!moreRS)
+			System.out.println("FAIL - no fourth result set");
+		allRS[3] = cs.getResultSet();
+		// first, third and fourth open, second closed
+		showResultSetStatus(allRS);
+
+		System.out.println(" fifth with CLOSE_ALL_RESULTS");
+		moreRS = cs.getMoreResults(Statement.CLOSE_ALL_RESULTS);
+		if (!moreRS)
+			System.out.println("FAIL - no fifth result set");
+		allRS[4] = cs.getResultSet();
+		// only fifth open
+		showResultSetStatus(allRS);
+
+		System.out.println(" no more results with with KEEP_CURRENT_RESULT");
+		moreRS = cs.getMoreResults(Statement.KEEP_CURRENT_RESULT);
+		if (moreRS)
+			System.out.println("FAIL - too many result sets");
+		// only fifth open
+		showResultSetStatus(allRS);
+		allRS[4].close();
+		java.util.Arrays.fill(allRS, null);
+
+		System.out.println("\n\nFetching result sets with getMoreResults(Statement.KEEP_CURRENT_RESULT) and checking that cs.execute() closes them");
+		pass = 0;
+		cs.execute();
+		do {
+
+			allRS[pass++] = cs.getResultSet();
+			System.out.println("  PASS " + pass + " got result set " + (allRS[pass -1] != null));
+			// expect everything to stay open.
+			showResultSetStatus(allRS);
+
+		} while (cs.getMoreResults(Statement.KEEP_CURRENT_RESULT));
+		System.out.println(" fetched all results");
+		// All should still be open.
+		showResultSetStatus(allRS);
+		System.out.println(" executing statement");
+		cs.execute();
+		// all should be closed.
+		showResultSetStatus(allRS);
+		java.util.Arrays.fill(allRS, null);
+
+
+		System.out.println("\n\nFetching result sets with getMoreResults(Statement.KEEP_CURRENT_RESULT) and checking that cs.close() closes them");
+		pass = 0;
+		// using execute from above.
+		do {
+
+			allRS[pass++] = cs.getResultSet();
+			System.out.println("  PASS " + pass + " got result set " + (allRS[pass -1] != null));
+			// expect everything to stay open.
+			showResultSetStatus(allRS);
+
+		} while (cs.getMoreResults(Statement.KEEP_CURRENT_RESULT));
+		System.out.println(" fetched all results");
+		// All should still be open.
+		showResultSetStatus(allRS);
+		System.out.println(" closing statement");
+		cs.close();
+		// all should be closed.
+		showResultSetStatus(allRS);
+		java.util.Arrays.fill(allRS, null);
+
+	}
+
+	private static void showResultSetStatus(ResultSet[] allRS) {
+		for (int i = 0; i < allRS.length; i++) {
+			try {
+				ResultSet rs = allRS[i];
+				if (rs == null)
+					continue;
+				rs.next();
+				System.out.println("     RS (" + (i + 1) + ") val " + rs.getInt(1));
+			} catch (SQLException sqle) {
+				System.out.println("     Exception - " + sqle.getMessage());
+			}
+		}
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,353 @@
+-- create some tables
+create table t1(c50 char(50), i int);
+create table t2(c50 char(50), i int);
+
+-- populate tables
+insert into t1 values ('b', 2), ('c', 3), ('d', 4), ('e', 5),
+		      ('f', 6), ('g', 7), ('h', 8), ('i', 9),
+		      ('j', 10), ('k', 11), ('l', 12), ('m', 13);
+
+autocommit off;
+
+-- negative
+
+-- position on forward only cursor
+get cursor c1 as 'select i from t1';
+getcurrentrownumber c1;
+first c1;
+last c1;
+previous c1;
+next c1;
+before first c1;
+after last c1;
+absolute 1 c1;
+relative 1 c1;
+close c1;
+
+get scroll insensitive cursor c1 as 'select * from t1';
+-- 0 is invalid value for absolute
+absolute 0 c1;
+close c1;
+get scroll insensitive cursor c1 as 'select * from t1';
+-- relative is invalid when not positioned on a row
+relative 0 c1;
+close c1;
+get scroll insensitive cursor c1 as 'select * from t1';
+-- relative is invalid when not positioned on a row
+relative 2 c1;
+close c1;
+
+
+-- positive
+
+-- test positioning
+get scroll insensitive cursor c1 as 'select * from t1';
+-- 2
+first c1;
+getcurrentrownumber c1;
+-- 3
+next c1;
+getcurrentrownumber c1;
+-- 2
+first c1;
+getcurrentrownumber c1;
+-- 3
+next c1;
+getcurrentrownumber c1;
+-- 4
+next c1;
+getcurrentrownumber c1;
+-- 2
+first c1;
+getcurrentrownumber c1;
+-- 3
+next c1;
+getcurrentrownumber c1;
+-- null
+after last c1;
+getcurrentrownumber c1;
+-- beetle 5509
+-- null
+next c1;
+-- beetle 5509
+getcurrentrownumber c1;
+-- beetle 5509
+-- 13
+previous c1;
+-- beetle 5509
+getcurrentrownumber c1;
+-- beetle 5509
+-- 12
+previous c1;
+-- beetle 5509
+getcurrentrownumber c1;
+-- 13
+last c1;
+getcurrentrownumber c1;
+-- null
+before first c1;
+getcurrentrownumber c1;
+-- 2
+next c1;
+getcurrentrownumber c1;
+-- 13
+absolute 12 c1;
+getcurrentrownumber c1;
+-- 3
+absolute -11 c1;
+getcurrentrownumber c1;
+-- null
+absolute 13 c1;
+getcurrentrownumber c1;
+-- null
+absolute -13 c1;
+getcurrentrownumber c1;
+-- absolute -1 should be last row
+absolute -1 c1;
+getcurrentrownumber c1;
+close c1;
+
+-- do last first
+get scroll insensitive cursor c1 as 'select * from t1';
+-- 13
+last c1;
+getcurrentrownumber c1;
+-- null
+next c1;
+getcurrentrownumber c1;
+-- 13
+last c1;
+getcurrentrownumber c1;
+-- 12
+previous c1;
+getcurrentrownumber c1;
+-- 2
+first c1;
+getcurrentrownumber c1;
+-- null
+previous c1;
+getcurrentrownumber c1;
+-- 2
+next c1;
+getcurrentrownumber c1;
+close c1;
+
+-- do after last first
+get scroll insensitive cursor c1 as 'select * from t1';
+-- null
+after last c1;
+-- 13
+previous c1;
+-- 12
+previous c1;
+close c1;
+
+-- go to next to last row, then do next
+get scroll insensitive cursor c1 as 'select * from t1 where i >= 11';
+-- 11
+next c1;
+getcurrentrownumber c1;
+-- 12
+next c1;
+getcurrentrownumber c1;
+-- 13
+last c1;
+getcurrentrownumber c1;
+-- 12
+previous c1;
+getcurrentrownumber c1;
+-- null
+after last c1;
+getcurrentrownumber c1;
+-- 13
+previous c1;
+close c1;
+
+-- start at after last
+get scroll insensitive cursor c1 as 'select * from t1 where i >= 11';
+-- null
+after last c1;
+getcurrentrownumber c1;
+-- 13
+previous c1;
+getcurrentrownumber c1;
+close c1;
+
+-- use absolute to get rows before
+-- scan would get to them
+get scroll insensitive cursor c1 as 'select i from t1';
+-- 6
+absolute 5 c1;
+getcurrentrownumber c1;
+-- 9
+absolute -5 c1;
+getcurrentrownumber c1;
+-- 6
+absolute 5 c1;
+getcurrentrownumber c1;
+close c1;
+
+get scroll insensitive cursor c1 as 'select i from t1';
+-- null
+absolute 13 c1;
+getcurrentrownumber c1;
+-- 13
+previous c1;
+getcurrentrownumber c1;
+close c1;
+
+get scroll insensitive cursor c1 as 'select i from t1';
+-- null
+absolute -13 c1;
+getcurrentrownumber c1;
+-- 2
+next c1;
+getcurrentrownumber c1;
+close c1;
+
+-- test relative implementation
+get scroll insensitive cursor c1 as 'select i from t1';
+-- 2
+first c1;
+getcurrentrownumber c1;
+-- 13
+relative 11 c1;
+getcurrentrownumber c1;
+-- null
+relative 1 c1;
+getcurrentrownumber c1;
+-- 13
+last c1;
+getcurrentrownumber c1;
+-- 2
+relative -11 c1;
+getcurrentrownumber c1;
+close c1;
+
+
+-- scroll sensitive cursor becomes scroll insensitive
+commit;
+get scroll sensitive cursor c1 as 'select i from t1';
+first c1;
+next c1;
+update t1 set i = 666 where i = 2;
+first c1;
+rollback;
+
+-- verify that statement cache works
+-- correctly with scroll and forward only
+-- cursors on same query text
+get scroll insensitive cursor c1 as 'select i from t1';
+get cursor c2 as 'select i from t1';
+first c1;
+next c2;
+first c2;
+close c1;
+close c2;
+
+-- first, last, etc. on empty result set
+get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+first c1;
+getcurrentrownumber c1;
+previous c1;
+getcurrentrownumber c1;
+next c1;
+getcurrentrownumber c1;
+last c1;
+getcurrentrownumber c1;
+next c1;
+getcurrentrownumber c1;
+previous c1;
+getcurrentrownumber c1;
+absolute 1 c1;
+getcurrentrownumber c1;
+absolute -1 c1;
+getcurrentrownumber c1;
+close c1;
+
+get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+after last c1;
+getcurrentrownumber c1;
+previous c1;
+getcurrentrownumber c1;
+before first c1;
+getcurrentrownumber c1;
+next c1;
+getcurrentrownumber c1;
+close c1;
+
+get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+absolute 1 c1;
+absolute -1 c1;
+close c1;
+
+get scroll insensitive cursor c1 as 'select i from t1 where 1=0';
+absolute -1 c1;
+absolute 1 c1;
+close c1;
+
+autocommit on;
+get scroll insensitive with hold cursor c1 as 'select i from t1 where 1=0';
+first c1;
+first c1;
+last c1;
+last c1;
+absolute 1 c1;
+absolute -1 c1;
+before first c1;
+after last c1;
+previous c1;
+next c1;
+-- beetle 5510
+next c1;
+close c1;
+
+-- cursor on a sort
+get scroll insensitive cursor c1 as 'select * from t1 order by i desc';
+-- 2
+last c1;
+-- 13
+first c1;
+-- 2
+relative 11 c1;
+-- 3
+previous c1;
+close c1;
+
+-- RTS
+call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+maximumdisplaywidth 2000;
+get scroll insensitive cursor c1 as 'select * from t1';
+last c1;
+first c1;
+next c1;
+close c1;
+values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+get scroll insensitive cursor c1 as 'select * from t1';
+close c1;
+
+-- for following set of tests, setting the holdability over commit to false for this connection since that is what we want to test below
+-- Using this rather than passing with nohold to cursor statement because this test also runs in jdk13 and lower and there is no way to
+-- set the holdability using jdbc api in those jdks (unless trying that through a jdbc program where one can use reflection to set holdability
+-- in jdk131)
+NoholdForConnection;
+-- beetle 4551 - insensitive cursor uses estimated row count which might be
+-- pessimistic and will get out of memory error
+create table big(a int generated always as identity (start with 1, increment by 1));
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+insert into big values(default);
+get scroll insensitive cursor s1 as
+'select * from big b1 left outer join  big b2 on b1.a = b2.a left outer join  big b3 on b2.a = b3.a left outer join big b4 on b3.a = b4.a left outer join (big b5 left outer join (big b6 left outer join (big b7 left outer join big b8 on b7.a = b8.a) on b6.a=b7.a) on b5.a = b6.a) on b4.a = b5.a';
+
+-- clean up
+drop table t1;
+drop table t2;
+drop table big;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1381 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.lang.scrollCursors2
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.lang;
+
+import java.io.IOException;
+
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Types;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test of scroll cursors.
+ *
+ * @author Jerry Brenner
+ */
+
+public class scrollCursors2 { 
+
+	public static void main(String[] args) {
+		boolean		passed = true;
+		Connection	conn = null;
+		Statement	s_i_r = null;
+
+		/* Run all parts of this test, and catch any exceptions */
+		try {
+			System.out.println("Test scrollCurors2 starting");
+
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			conn = ij.startJBMS();
+			conn.setAutoCommit(false);
+
+			/* Create the table and do any other set-up */
+			passed = passed && setUpTest(conn);
+
+			// Negative tests with forward only cursors.
+			passed = passed && forwardOnlyNegative(conn);
+
+			// Positive tests with forward only cursors.
+			passed = passed && forwardOnlyPositive(conn);
+
+			// Tests with scroll sensitive cursors
+			passed = passed && scrollSensitiveTest(conn);
+
+			// Positive tests for scroll insensitive cursors
+			passed = passed && scrollInsensitivePositive(conn);
+
+			// Negative tests for scroll insensitive cursors
+			passed = passed && scrollInsensitiveNegative(conn);
+
+			// "test" scrolling and CallableStatements
+			passed = passed && testCallableStatements(conn);
+
+			// tests for PreparedStatement.getMetaData()
+			passed = passed && getMetaDataTests(conn);
+			
+
+		} 
+		catch (SQLException se) 
+		{
+			passed = false;
+			dumpSQLExceptions(se);
+		} 
+		catch (Throwable e) 
+		{
+			System.out.println("FAIL -- unexpected exception caught in main():\n");
+			System.out.println(e.getMessage());
+			e.printStackTrace();
+			passed = false;
+		} 
+		finally 
+		{
+
+			/* Test is finished - clean up after ourselves */
+			passed = passed && cleanUp(conn, s_i_r);
+		}
+
+		if (passed)
+			System.out.println("PASS");
+
+		System.out.println("Test scrollCursors2 finished");
+	}
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception");
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se.printStackTrace();
+			se = se.getNextException();
+		}
+	}
+
+	/**
+	 * Set up the test.
+	 *
+	 * This method creates the table used by the rest of the test.
+	 *
+	 * @param conn	The Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean setUpTest(Connection conn)
+					throws SQLException 
+	{
+		boolean	passed = true;
+		int		rows;
+		PreparedStatement	ps;
+		Statement			s_i_r;
+
+		s_i_r = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_READ_ONLY);
+
+		/* Create a table */
+		s_i_r.execute("create table t (i int, c50 char(50))");
+
+	    /* Populate the table */
+		s_i_r.execute("insert into t (i) values (2), (3), (4), (5), (6)");
+		s_i_r.execute("update t set c50 = RTRIM(CAST (i AS CHAR(50)))");
+		s_i_r.close();
+
+		return passed;
+	}
+
+	/**
+	 * Negative tests for forward only cursors.
+	 *
+	 * This method tests forward only cursors.
+	 *
+	 * @param conn	The Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean forwardOnlyNegative( Connection conn)
+		throws SQLException 
+	{
+		boolean		passed = true;
+		PreparedStatement	ps_f_r = null;
+		PreparedStatement	ps_f_u = null;
+		ResultSet	rs;
+		SQLWarning	warning;
+		Statement	s_f_r = null;
+		Statement	s_f_u = null;
+
+		s_f_r = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+									 ResultSet.CONCUR_READ_ONLY);
+		// We should have gotten no warnings and a read only forward only cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that setMaxRows(-1) fails
+		try
+		{
+			s_f_r.setMaxRows(-1);
+			// Should never get here
+			System.out.println("setMaxRows(-1) expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ063");
+		}
+		// Verify maxRows still 0
+		if (s_f_r.getMaxRows() != 0)
+		{
+			System.out.println("getMaxRows() expected to return 0");
+			passed = false;
+		}
+
+		// Verify that result set from statement is 
+		// scroll insensitive and read only
+		rs = s_f_r.executeQuery("select * from t");
+		if (rs.getType() != ResultSet.TYPE_FORWARD_ONLY)
+		{
+			System.out.println("cursor type = " + rs.getType() +
+							   ", not " + ResultSet.TYPE_FORWARD_ONLY);
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println("concurrency = " + rs.getConcurrency() +
+							   ", not " + ResultSet.CONCUR_READ_ONLY);
+		}
+
+		// Verify that first(), etc. don't work
+		try
+		{
+			rs.first();
+			// Should never get here
+			System.out.println("first() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.beforeFirst();
+			// Should never get here
+			System.out.println("beforeFirst() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.isBeforeFirst();
+			// Should never get here
+			System.out.println("isBeforeFirst() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.isAfterLast();
+			// Should never get here
+			System.out.println("isAfterLast() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.isFirst();
+			// Should never get here
+			System.out.println("isFirst() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.isLast();
+			// Should never get here
+			System.out.println("isLast() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.absolute(1);
+			// Should never get here
+			System.out.println("absolute() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		try
+		{
+			rs.relative(1);
+			// Should never get here
+			System.out.println("relative() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+
+		// setFetchDirection should fail
+		try
+		{
+			rs.setFetchDirection(ResultSet.FETCH_FORWARD);
+			// Should never get here
+			System.out.println("setFetchDirection() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+
+		/* Book says that getFetchDirection(), getFetchSize() and
+		 * setFetchSize() are all okay.
+		 */
+		if (rs.getFetchSize() != 1)
+	 	{
+			System.out.println("getFetchSize() expected to return 1");
+			passed = false;
+		}
+		rs.setFetchSize(5);
+		if (rs.getFetchSize() != 5)
+	 	{
+			System.out.println("getFetchSize() expected to return 5");
+			passed = false;
+		}
+
+		if (rs.getFetchDirection() != ResultSet.FETCH_FORWARD)
+		{
+			System.out.println(
+				"getFetchDirection() expected to return FETCH_FORWARD, not " +
+				rs.getFetchDirection());
+			passed = false;
+		}
+
+		rs.close();
+		s_f_r.close();
+
+		s_f_u = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+									 ResultSet.CONCUR_UPDATABLE);
+		// We should have gotten 1 warning and a read only forward only cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that result set from statement is 
+		// scroll insensitive and read only
+		rs = s_f_u.executeQuery("select * from t");
+		if (rs.getType() != ResultSet.TYPE_FORWARD_ONLY)
+		{
+			System.out.println("cursor type = " + rs.getType() +
+							   ", not " + ResultSet.TYPE_FORWARD_ONLY);
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println("concurrency = " + rs.getConcurrency() +
+							   ", not " + ResultSet.CONCUR_READ_ONLY);
+		}
+
+		rs.close();
+
+
+		ps_f_r = conn.prepareStatement(
+									 "select * from t",
+									 ResultSet.TYPE_FORWARD_ONLY,
+									 ResultSet.CONCUR_READ_ONLY);
+		// We should have gotten no warnings and a read only forward only cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that result set from statement is 
+		// scroll insensitive and read only
+		rs = ps_f_r.executeQuery();
+		if (rs.getType() != ResultSet.TYPE_FORWARD_ONLY)
+		{
+			System.out.println("cursor type = " + rs.getType() +
+							   ", not " + ResultSet.TYPE_FORWARD_ONLY);
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println("concurrency = " + rs.getConcurrency() +
+							   ", not " + ResultSet.CONCUR_READ_ONLY);
+		}
+
+		// Verify that first() doesn't work
+		try
+		{
+			rs.first();
+			// Should never get here
+			System.out.println("first() expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ061");
+		}
+		rs.close();
+		ps_f_r.close();
+
+		ps_f_u = conn.prepareStatement(
+									 "select * from t",
+									 ResultSet.TYPE_FORWARD_ONLY,
+									 ResultSet.CONCUR_UPDATABLE);
+		// We should have gotten 1 warning and a read only forward only cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that result set from statement is 
+		// scroll insensitive and read only
+		rs = ps_f_u.executeQuery();
+		if (rs.getType() != ResultSet.TYPE_FORWARD_ONLY)
+		{
+			System.out.println("cursor type = " + rs.getType() +
+							   ", not " + ResultSet.TYPE_FORWARD_ONLY);
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println("concurrency = " + rs.getConcurrency() +
+							   ", not " + ResultSet.CONCUR_READ_ONLY);
+		}
+
+		rs.close();
+		ps_f_u.close();
+
+		return passed;
+	}
+
+	/**
+	 * Positive tests for forward only cursors.
+	 *
+	 * This method tests forward only cursors.
+	 *
+	 * @param conn	The Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean forwardOnlyPositive( Connection conn)
+		throws SQLException 
+	{
+		boolean		passed = true;
+		ResultSet	rs;
+		SQLWarning	warning;
+		Statement	s_f_r = null;
+
+		s_f_r = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+									 ResultSet.CONCUR_READ_ONLY);
+		// We should have gotten no warnings and a read only forward only cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that setMaxRows(4) succeeds
+		s_f_r.setMaxRows(5);
+		if (s_f_r.getMaxRows() != 5)
+		{
+			System.out.println("getMaxRows() expected to return 5");
+			passed = false;
+		}
+		rs = s_f_r.executeQuery("values 1, 2, 3, 4, 5, 6");
+		if (rs == null)
+		{
+			System.out.println("rs expected to be non-null.");
+			passed = false;
+		}
+		// Iterate straight thru RS, expect only 5 rows.
+		for (int index = 1; index < 6; index++)
+		{
+			if (! rs.next())
+			{
+				System.out.println("rs.next() failed, index = " + index);
+				passed = false;
+				break;
+			}
+		}
+		// We should not see another row (only 5, not 6)
+		if (rs.next())
+		{
+			System.out.println("rs.next() failed, should not have seen 6th row.");
+			passed = false;
+		}
+		rs.close();
+		s_f_r.close();
+		return passed;
+	}
+
+	/**
+	 * Scroll sensitive cursor tests
+	 *
+	 * This method tests scroll sensitive cursors.
+	 * (Not implemented, so we should get back
+	 * scroll insensitive curors with read only concurrency.) 
+	 *
+	 * @param conn	The Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean scrollSensitiveTest( Connection conn)
+		throws SQLException 
+	{
+		ResultSet	rs;
+		SQLWarning	warning;
+		Statement	s_s_r = null; // sensitive, read only
+		Statement	s_s_u = null; // sensitive, updatable
+
+
+		s_s_r = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
+									 ResultSet.CONCUR_READ_ONLY);
+
+		// We should have gotten a warning and a scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that result set from statement is 
+		// scroll insensitive and read only
+		rs = s_s_r.executeQuery("select * from t");
+		if (rs.getType() != ResultSet.TYPE_SCROLL_INSENSITIVE)
+		{
+			System.out.println("cursor type = " + rs.getType() +
+							   ", not " + ResultSet.TYPE_SCROLL_INSENSITIVE);
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println("concurrency = " + rs.getConcurrency() +
+							   ", not " + ResultSet.CONCUR_READ_ONLY);
+		}
+		rs.close();
+
+		// Close the statement
+		s_s_r.close();
+
+		s_s_u = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
+									 ResultSet.CONCUR_UPDATABLE);
+		// We should have gotten 2 warnings and a read only scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+
+		// Verify that result set from statement is 
+		// scroll insensitive and read only
+		rs = s_s_u.executeQuery("select * from t");
+		if (rs.getType() != ResultSet.TYPE_SCROLL_INSENSITIVE)
+		{
+			System.out.println("cursor type = " + rs.getType() +
+							   ", not " + ResultSet.TYPE_SCROLL_INSENSITIVE);
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println("concurrency = " + rs.getConcurrency() +
+							   ", not " + ResultSet.CONCUR_READ_ONLY);
+		}
+		rs.close();
+
+
+		return true;
+	}
+
+	/**
+ 	 * Positive tests for scroll insensitive cursor.
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean scrollInsensitivePositive( Connection conn)
+		throws SQLException 
+	{
+		boolean 	passed = true;
+		PreparedStatement ps_i_r = null;
+		PreparedStatement ps_i_u = null;
+		ResultSet	rs;
+		SQLWarning	warning;
+		Statement	s_i_r = null; // insensitive, read only
+		Statement	s_i_u = null; // insensitive, updatable
+
+
+		s_i_r = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_READ_ONLY);
+
+		// We should not have gotten any warnings 
+		// and should have gotten a scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("unexpected warning = " + warning);
+			warning = warning.getNextWarning();
+			passed = false;
+		}
+		conn.clearWarnings();
+
+		// run a query
+		rs = s_i_r.executeQuery("select * from t");
+		// verify scroll insensitive and read only
+		if (rs.getType() != ResultSet.TYPE_SCROLL_INSENSITIVE)
+		{
+			System.out.println(
+				"rs.getType() expected to return TYPE_SCROLL_INSENSITIVE, not " +
+				rs.getType());
+			passed = false;
+		}
+		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		{
+			System.out.println(
+				"rs.getConcurrency() expected to return CONCUR_READ_ONLY, not " +
+				rs.getConcurrency());
+			passed = false;
+		}
+		
+		// We should be positioned before the 1st row
+		if (! rs.isBeforeFirst())
+		{
+			System.out.println("expected to be before the 1st row");
+			passed = false;
+		}
+		// go to first row
+		if (! rs.first())
+		{
+			System.out.println("expected first() to succeed");
+			passed = false;
+		}
+		if (rs.getInt(1) != 2)
+		{
+			System.out.println(
+				"rs.getInt(1) expected to return 2, not " + rs.getInt(1));
+			passed = false;
+		}
+		if (! rs.isFirst())
+		{
+			System.out.println("expected to be on the 1st row");
+			passed = false;
+		}
+		// move to before first
+		rs.beforeFirst();
+		if (! rs.isBeforeFirst())
+		{
+			System.out.println("expected to be before the 1st row");
+			passed = false;
+		}
+		// move to last row
+		if (! rs.last())
+		{
+			System.out.println("expected last() to succeed");
+			passed = false;
+		}
+		if (! rs.isLast())
+		{
+			System.out.println("expected to be on the last row");
+			passed = false;
+		}
+		if (rs.isAfterLast())
+		{
+			System.out.println("not expected to be after the last row");
+			passed = false;
+		}
+		if (rs.getInt(1) != 6)
+		{
+			System.out.println(
+				"rs.getInt(1) expected to return 6, not " + rs.getInt(1));
+			passed = false;
+		}
+		if (rs.next())
+		{
+			System.out.println("not expected to find another row");
+			passed = false;
+		}
+		if (! rs.isAfterLast())
+		{
+			System.out.println("expected to be after the last row");
+			passed = false;
+		}
+
+		// We're after the last row, verify that only isAfterLast()
+		// returns true
+		if (rs.isLast())
+		{
+			System.out.println("not expected to be on the last row");
+			passed = false;
+		}
+		if (rs.isFirst())
+		{
+			System.out.println("not expected to be on the first row");
+			passed = false;
+		}
+		if (rs.isBeforeFirst())
+		{
+			System.out.println("not expected to be before the first row");
+			passed = false;
+		}
+
+		// get/setFetchDirection()
+		if (rs.getFetchDirection() != ResultSet.FETCH_FORWARD)
+		{
+			System.out.println(
+				"getFetchDirection() expected to return FETCH_FORWARD, not " +
+				rs.getFetchDirection());
+			passed = false;
+		}
+		rs.setFetchDirection(ResultSet.FETCH_UNKNOWN);
+		if (rs.getFetchDirection() != ResultSet.FETCH_UNKNOWN)
+		{
+			System.out.println(
+				"getFetchDirection() expected to return FETCH_UNKNOWN, not " +
+				rs.getFetchDirection());
+			passed = false;
+		}
+
+		// get/setFetchSize()
+		if (rs.getFetchSize() != 1)
+		{
+			System.out.println(
+				"getFetchSize() expected to return 1, not " + rs.getFetchSize());
+			passed = false;
+		}
+		rs.setFetchSize(5);
+		if (rs.getFetchSize() != 5)
+		{
+			System.out.println(
+				"getFetchSize() expected to return 5, not " + rs.getFetchSize());
+			passed = false;
+		}
+		// setFetchSize() to 0 should have no effect.
+		rs.setFetchSize(0);
+		if (rs.getFetchSize() != 5)
+		{
+			System.out.println(
+				"getFetchSize() expected to return 5, not " + rs.getFetchSize());
+			passed = false;
+		}
+
+		// done
+		rs.close();
+
+
+		// Scroll insensitive and updatable
+		s_i_u = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_UPDATABLE);
+
+		// We should have gotten 1 warning 
+		// and a read only scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+		s_i_u.close();
+
+		ps_i_r = conn.prepareStatement(
+									 "select * from t",
+									 ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_READ_ONLY);
+
+		// We should not have gotten any warnings 
+		// and should have gotten a prepared scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("unexpected warning = " + warning);
+			warning = warning.getNextWarning();
+			passed = false;
+		}
+		conn.clearWarnings();
+
+		rs = ps_i_r.executeQuery();
+		// make sure it's scrollable
+		rs.last();
+		rs.close();
+		ps_i_r.close();
+
+		ps_i_u = conn.prepareStatement(
+									 "select * from t",
+									 ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_UPDATABLE);
+
+		// We should have gotten 1 warning 
+		// and a read only scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+		}
+		conn.clearWarnings();
+		ps_i_u.close();
+
+		// Check setMaxRows()/getMaxRows()
+		if (s_i_r.getMaxRows() != 0)
+		{
+			System.out.println("getMaxRows() expected to return 0");
+			passed = false;
+		}
+		s_i_r.setMaxRows(5);
+		if (s_i_r.getMaxRows() != 5)
+		{
+			System.out.println("getMaxRows() expected to return 5");
+			passed = false;
+		}
+		rs = s_i_r.executeQuery("values 1, 2, 3, 4, 5, 6");
+		if (rs == null)
+		{
+			System.out.println("rs expected to be non-null.");
+			passed = false;
+		}
+		// Iterate straight thru RS, expect only 5 rows.
+		for (int index = 1; index < 6; index++)
+		{
+			if (! rs.next())
+			{
+				System.out.println("rs.next() failed, index = " + index);
+				passed = false;
+				break;
+			}
+		}
+		// We should not see another row (only 5, not 6)
+		if (rs.next())
+		{
+			System.out.println("rs.next() failed, should not have seen 6th row.");
+			passed = false;
+		}
+		rs.close();
+		// Jump around and verify setMaxRows() works.
+		rs = s_i_r.executeQuery("values 1, 2, 3, 4, 5, 6");
+		if (rs == null)
+		{
+			System.out.println("rs expected to be non-null.");
+			passed = false;
+		}
+		if (!rs.last())
+		{
+			System.out.println("rs.last() failed.");
+			passed = false;
+		}
+		// Iterate backwards thru RS, expect only 4 more (5 total) rows.
+		for (int index = 1; index < 5; index++)
+		{
+			if (! rs.previous())
+			{
+				System.out.println("rs.previous() failed, index = " + index);
+				passed = false;
+				break;
+			}
+		}
+		// We should not see another row (only 5, not 6)
+		if (rs.previous())
+		{
+			System.out.println("rs.previous() failed, should not have seen 6th row.");
+			passed = false;
+		}
+		rs.close();
+		rs = s_i_r.executeQuery("values 1, 2, 3, 4, 5, 6");
+		if (rs == null)
+		{
+			System.out.println("rs expected to be non-null.");
+			passed = false;
+		}
+		rs.afterLast();
+		// Iterate backwards thru RS, expect only 5 rows.
+		for (int index = 1; index < 6; index++)
+		{
+			if (! rs.previous())
+			{
+				System.out.println("rs.previous() failed, index = " + index);
+				passed = false;
+				break;
+			}
+		}
+		// We should not see another row (only 5, not 6)
+		if (rs.previous())
+		{
+			System.out.println("rs.previous() failed, should not have seen 6th row.");
+			passed = false;
+		}
+		rs.close();
+		// Verify setting maxRows back to 0 works.
+		s_i_r.setMaxRows(0);
+		rs = s_i_r.executeQuery("values 1, 2, 3, 4, 5, 6");
+		if (rs == null)
+		{
+			System.out.println("rs expected to be non-null.");
+			passed = false;
+		}
+		// Iterate straight thru RS, expect 6 rows.
+		for (int index = 1; index < 7; index++)
+		{
+			if (! rs.next())
+			{
+				System.out.println("rs.next() failed, index = " + index);
+				passed = false;
+				break;
+			}
+		}
+		// We should not see another row 
+		if (rs.next())
+		{
+			System.out.println("rs.next() failed, should not have seen another row.");
+			passed = false;
+		}
+		rs.close();
+		
+
+		return passed;
+	}
+
+	/**
+ 	 * Negative tests for scroll insensitive cursor.
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean scrollInsensitiveNegative( Connection conn)
+		throws SQLException 
+	{
+		boolean 	passed = true;
+		ResultSet	rs;
+		SQLWarning	warning;
+		Statement	s_i_r = null; // insensitive, read only
+
+		s_i_r = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_READ_ONLY);
+
+		// We should not have gotten any warnings 
+		// and should have gotten a scroll insensitive cursor
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("unexpected warning = " + warning);
+			warning = warning.getNextWarning();
+			passed = false;
+		}
+		conn.clearWarnings();
+
+		// Verify that setMaxRows(-1) fails
+		try
+		{
+			s_i_r.setMaxRows(-1);
+			// Should never get here
+			System.out.println("setMaxRows(-1) expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ063");
+		}
+		// Verify maxRows still 0
+		if (s_i_r.getMaxRows() != 0)
+		{
+			System.out.println("getMaxRows() expected to return 0");
+			passed = false;
+		}
+
+		// Empty result set
+		rs = s_i_r.executeQuery("select * from t where 1=0");
+		// isBeforeFirst() and isAfterLast() should always return false
+		// when result set is empty
+		if (rs.isBeforeFirst())
+		{
+			System.out.println("isBeforeFirst() expected to return false on empty result set");
+			passed = false;
+		}
+		if (rs.next())
+		{
+			System.out.println("rs.next() expected to show result set is empty");
+			passed = false;
+		}
+		if (rs.isAfterLast())
+		{
+			System.out.println("isAfterLast() expected to return false on empty result set");
+			passed = false;
+		}
+		if (rs.isFirst())
+		{
+			System.out.println("isFirst() expected to return false on empty result set");
+			passed = false;
+		}
+		if (rs.isLast())
+		{
+			System.out.println("isLast() expected to return false on empty result set");
+			passed = false;
+		}
+
+		rs.close();
+		// End of empty result set tests
+
+		// Non-empty result set
+		rs = s_i_r.executeQuery("select * from t");
+		// Negative fetch size
+		try
+		{
+			rs.setFetchSize(-5);
+			System.out.println("setFetchSize(-5) expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "XJ062");
+		}
+
+		// absolute(0)
+		try
+		{
+			rs.absolute(0);
+			System.out.println("absolute(0) expected to fail");
+			passed = false;
+		}
+		catch (SQLException sqle)
+		{
+			/* Check to be sure the exception is the one we expect */
+			passed = passed && checkException(sqle, "X0X86");
+		}
+
+		s_i_r.close();
+
+		return passed;
+	}
+
+
+	/**
+	 * CallableStatement tests.
+	 *
+	 * @param conn	The Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	public static boolean testCallableStatements( Connection conn)
+		throws SQLException 
+	{
+		boolean		passed = true;
+		int			warningCount = 0;
+		SQLWarning	warning;
+		CallableStatement	cs_s_r = null; // sensitive, read only
+		CallableStatement	cs_s_u = null; // sensitive, updatable
+		CallableStatement	cs_i_r = null; // insensitive, read only
+		CallableStatement	cs_i_u = null; // insensitive, updatable
+		CallableStatement	cs_f_r = null; // forward only, read only
+		CallableStatement	cs_f_u = null; // forward only, updatable
+
+		cs_s_r = conn.prepareCall(
+								"values cast (? as Integer)",
+								ResultSet.TYPE_SCROLL_SENSITIVE,
+								ResultSet.CONCUR_READ_ONLY);
+
+		// We should have gotten 1 warnings
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+			warningCount++;
+		}
+		if (warningCount != 1)
+		{
+			System.out.println("warningCount expected to be 1, not " + warningCount);
+			passed = false;
+		}
+		conn.clearWarnings();
+		cs_s_r.close();	
+
+		cs_s_u = conn.prepareCall(
+								"values cast (? as Integer)",
+								ResultSet.TYPE_SCROLL_SENSITIVE,
+								ResultSet.CONCUR_UPDATABLE);
+
+		// We should have gotten 2 warnings
+		warningCount = 0;
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+			warningCount++;
+		}
+		if (warningCount != 2)
+		{
+			System.out.println("warningCount expected to be 2, not " + warningCount);
+			passed = false;
+		}
+		conn.clearWarnings();
+		cs_s_u.close();	
+
+		cs_i_r = conn.prepareCall(
+								"values cast (? as Integer)",
+								ResultSet.TYPE_SCROLL_INSENSITIVE,
+								ResultSet.CONCUR_READ_ONLY);
+
+		// We should have gotten 0 warnings
+		warningCount = 0;
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+			warningCount++;
+		}
+		if (warningCount != 0)
+		{
+			System.out.println("warningCount expected to be 0, not " + warningCount);
+			passed = false;
+		}
+		conn.clearWarnings();
+		cs_i_r.close();	
+
+		cs_i_u = conn.prepareCall(
+								"values cast (? as Integer)",
+								ResultSet.TYPE_SCROLL_INSENSITIVE,
+								ResultSet.CONCUR_UPDATABLE);
+
+		// We should have gotten 1 warnings
+		warningCount = 0;
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+			warningCount++;
+		}
+		if (warningCount != 1)
+		{
+			System.out.println("warningCount expected to be 1, not " + warningCount);
+			passed = false;
+		}
+		conn.clearWarnings();
+		cs_i_u.close();	
+
+		cs_f_r = conn.prepareCall(
+								"values cast (? as Integer)",
+								ResultSet.TYPE_FORWARD_ONLY,
+								ResultSet.CONCUR_READ_ONLY);
+
+		// We should have gotten 0 warnings
+		warningCount = 0;
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+			warningCount++;
+		}
+		if (warningCount != 0)
+		{
+			System.out.println("warningCount expected to be 0, not " + warningCount);
+			passed = false;
+		}
+		conn.clearWarnings();
+		cs_f_r.close();	
+
+		cs_f_u = conn.prepareCall(
+								"values cast (? as Integer)",
+								ResultSet.TYPE_FORWARD_ONLY,
+								ResultSet.CONCUR_UPDATABLE);
+
+		// We should have gotten 1 warnings
+		warningCount = 0;
+		warning = conn.getWarnings();
+		while (warning != null)
+		{
+			System.out.println("warning = " + warning);
+			warning = warning.getNextWarning();
+			warningCount++;
+		}
+		if (warningCount != 1)
+		{
+			System.out.println("warningCount expected to be 1, not " + warningCount);
+			passed = false;
+		}
+		conn.clearWarnings();
+		cs_f_u.close();	
+
+		return passed;
+	}
+
+
+	/**
+ 	 * Tests for PreparedStatement.getMetaData().
+	 *
+	 * @param conn	The connection to use.
+	 *
+	 * @return	Whether or not we were successful.
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+	static boolean getMetaDataTests( Connection conn)
+		throws SQLException 
+	{
+		boolean 	passed = true;
+		PreparedStatement	ps_f_r = null; // forward only, read only
+		ResultSet	rs;
+		ResultSetMetaData rsmd_ps;
+		ResultSetMetaData rsmd_rs;
+		SQLWarning	warning;
+
+
+		ps_f_r = conn.prepareStatement(
+									 "select c50, i, 43 from t",
+									 ResultSet.TYPE_FORWARD_ONLY,
+									 ResultSet.CONCUR_READ_ONLY);
+
+		rsmd_ps = ps_f_r.getMetaData();
+		if (rsmd_ps == null)
+		{
+			System.out.println("rsmd_ps expected to be non-null");
+			return false;
+		}
+
+		// Now get meta data from result set
+		rs = ps_f_r.executeQuery();
+		rsmd_rs = rs.getMetaData();
+		if (rsmd_rs == null)
+		{
+			System.out.println("rsmd_rs expected to be non-null");
+			return false;
+		}
+
+		// check column count
+		if (rsmd_ps.getColumnCount() != rsmd_rs.getColumnCount())
+		{
+			System.out.println("column count expected to be same, not " +
+							   rsmd_ps.getColumnCount() +
+							   " and " +
+							   rsmd_rs.getColumnCount());
+			passed = false;
+		}
+
+		// get column name for 2nd column
+		if (! rsmd_ps.getColumnName(2).equals(rsmd_rs.getColumnName(2)))
+		{
+			System.out.println("column name expected to be same, not " +
+							   rsmd_ps.getColumnName(2) +
+							   " and " +
+							   rsmd_rs.getColumnName(2));
+			passed = false;
+		}
+
+		if (rsmd_ps.isReadOnly(2) != rsmd_rs.isReadOnly(2))
+		{
+			System.out.println("isReadOnly() expected to be same, not " +
+							   rsmd_ps.isReadOnly(2) +
+							   " and " +
+							   rsmd_rs.isReadOnly(2));
+			passed = false;
+		}
+		
+		rs.close();
+		ps_f_r.close();
+
+		return passed;
+	}
+
+	/**
+	 * Check to make sure that the given SQLException is an exception
+	 * with the expected sqlstate.
+	 *
+	 * @param e		The SQLException to check
+	 * @param SQLState	The sqlstate to look for
+	 *
+	 * @return	true means the exception is the expected one
+	 */
+
+	private static boolean checkException(SQLException e,
+											String SQLState)
+	{
+		String				state;
+		String				nextState;
+		SQLException		next;
+		boolean				passed = true;
+
+		state = e.getSQLState();
+
+
+		if (! SQLState.equals(state)) {
+				System.out.println("FAIL -- unexpected exception " + e +
+					"sqlstate: " + state + SQLState);
+				passed = false;
+			}
+
+		return passed;
+	}
+
+	/**
+	 * Clean up after ourselves when testing is done.
+	 *
+	 * @param conn	The Connection
+	 * @param s		A Statement on the Connection
+	 *
+	 * @return	true if it succeeds, false if it doesn't
+	 *
+	 * @exception SQLException	Thrown if some unexpected error happens
+	 */
+
+	static boolean cleanUp(Connection conn, Statement s) {
+		try {
+			/* Drop the table we created */
+			if (s != null)
+			{
+				s.execute("drop table t");
+			}
+
+			/* Close the connection */
+			if (conn != null)
+			{
+				conn.commit();
+				conn.close();
+			}
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception caught in cleanup()");
+			JDBCDisplayUtil.ShowException(System.out, e);
+			return false;
+		}
+
+		return true;
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors3.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors3.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors3.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,42 @@
+disconnect;
+
+connect 'wombat;user=U1' AS C1;
+connect 'wombat;user=U2' AS C2;
+
+set connection C1;
+
+create table t1(c1 int, c2 int);
+insert into t1 values (1, 2), (3, 4), (5, 6), (7, 8), (9, 10);
+get scroll insensitive cursor c1 as 'select * from t1';
+
+set connection C2;
+-- see what happens to other user when we close our cursor
+-- before they are done.
+get scroll insensitive cursor c1 as 'select * from U1.t1';
+
+set connection C1;
+next c1;
+
+set connection C2;
+next c1;
+
+set connection C1;
+last c1;
+
+set connection C2;
+last c1;
+
+set connection C1;
+previous c1;
+
+set connection C2;
+close c1;
+
+set connection C1;
+first c1;
+close c1;
+
+drop table t1;
+disconnect;
+set connection C2;
+disconnect;

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache0.sql	Tue Jan 11 11:53:57 2005
@@ -7,7 +7,7 @@
 select count(*) from new org.apache.derby.diag.StatementCache() as SC;
 
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 autocommit off;
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/stmtCache1.sql	Tue Jan 11 11:53:57 2005
@@ -9,7 +9,7 @@
 autocommit off;
 -- set up aliases
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 CREATE PROCEDURE EC()
 EXTERNAL NAME 'org.apache.derby.diag.StatementCache.emptyCache'

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql	Tue Jan 11 11:53:57 2005
@@ -3,7 +3,7 @@
 --
 autocommit off;
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 autocommit off;
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery2.sql	Tue Jan 11 11:53:57 2005
@@ -2,7 +2,7 @@
 -- subquery tests (ANY and ALL subqueries)
 --
 CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
-EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.ConsistencyChecker.runConsistencyChecker'
+EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
 LANGUAGE JAVA PARAMETER STYLE JAVA;
 autocommit off;
 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,77 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.Beetle6038
+
+   Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+
+import java.sql.*;
+import java.io.*;
+import java.util.*;
+
+/**
+ *  Test that the two new encryption properties
+ *	DATA_ENCRYPT_ALGORITHM_VERSION="data_encrypt_algorithm_version"
+ *  LOG_ENCRYPT_ALGORITHM_VERSION="log_encrypt_algorithm_version"
+ *	exist and verify the version. Note, these values start off with 1.
+ */
+public class Beetle6038  {
+
+	public static void main(String[] args)
+		throws Exception
+	{
+		String driver = "org.apache.derby.jdbc.EmbeddedDriver";
+		Class.forName(driver).newInstance();
+		String dburl = null;
+
+		if(System.getProperty("java.vm.vendor") != null)
+		{
+			String vendor = System.getProperty("java.vm.vendor");
+			if(vendor.toUpperCase().lastIndexOf("SUN") != -1)
+				dburl="jdbc:derby:Beetle6038Db;create=true;dataEncryption=true;bootPassword=Thursday;encryptionAlgorithm=DES/CBC/NoPadding;encryptionProvider=com.sun.crypto.provider.SunJCE";
+			else
+			 dburl = "jdbc:derby:Beetle6038Db;create=true;dataEncryption=true;bootPassword=Thursday;encryptionAlgorithm=DES/CBC/NoPadding;encryptionProvider=com.ibm.crypto.provider.IBMJCE";
+		}
+
+		Connection conn = DriverManager.getConnection(dburl);
+		conn.close();
+		conn = DriverManager.getConnection(dburl);
+		conn.close();
+
+		// read in the properties in the service.properties file of the db
+		Properties serviceProperties = new Properties();
+		File f = new File("Beetle6038/Beetle6038Db/service.properties");
+		serviceProperties.load(new FileInputStream(f.getAbsolutePath()));
+
+		// check if the properties are set
+		checkProperty("data_encrypt_algorithm_version",serviceProperties);
+		checkProperty("log_encrypt_algorithm_version",serviceProperties);
+	}
+
+	public static void checkProperty(String name,Properties props)
+	{
+		String value = props.getProperty(name);
+
+		if( value == null )
+			System.out.println("Test failed!! - "+name + " not set in service.properties as expected");
+		else
+			System.out.println(name+"="+value);
+	}
+
+
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Beetle6038_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,16 @@
+#
+# This is the default system properties file for JSQL and JAVA tests.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+# If you want to alter these to use a different driver, connect to a different
+# database, or to not be used, override this file by creating
+# a file <testname>.sysprop to be used instead of this file.
+#
+#
+runwithj9=false
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,188 @@
+-- test lock escalation.  derby.locks.escalationThreshold=100 property 
+-- has been set to force lock escalation
+-- to occur at the minimum level of 100  locks.
+
+run resource 'createTestProcedures.subsql';
+run resource 'LockTableQuery.subsql';
+
+
+autocommit off;
+
+-- TEST 1 - make sure IX row locks are escalated to a persistent X table lock.
+
+create table foo (a int);
+
+commit;
+
+-- first insert 90 rows
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+
+-- check to make sure we have IX table and X row locks.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+-- now insert 10 more rows, pushing the lock over the escalation limit.
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+
+-- check to make sure we now just have a X table lock.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+-- insert 10 more rows to make sure we don't get rows locks from now on.
+insert into foo values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+
+-- check to make sure we now just have a X table lock.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+
+-- TEST 2 - make sure IS row locks are escalated to a persistent X table lock.
+
+create index foox on foo (a);
+
+commit;
+
+set isolation serializable;
+
+-- get IS row locks on just under 100 of the rows;
+select a from foo where a < 5;
+
+-- check to make sure we have IS table and S row locks.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+-- now get enough IS row locks to push over the lock escalation limit
+select a from foo where a >= 5;
+
+-- check to make sure we now just have a S table lock.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+-- make sure subsequent IS locks are recognized as covered by the S table lock.
+select a from foo where a = 8;
+
+-- check to make sure we now just have a S table lock.
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+-- TEST 3 - reproduce abort failure similar to bug 4328
+
+create table aborttest (keycol int, data varchar(1000));
+
+-- first insert 110 rows
+insert into aborttest values (0, PADSTRING('0',1000)), (0, PADSTRING('1',1000)), (0, PADSTRING('2',1000));
+insert into aborttest values (0, PADSTRING('3',1000)), (0, PADSTRING('4',1000)), (0, PADSTRING('5',1000));
+insert into aborttest values (0, PADSTRING('6',1000)), (0, PADSTRING('7',1000)), (0, PADSTRING('8',1000)), (0, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values  (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+insert into aborttest values (0, PADSTRING('0',1000)), (1, PADSTRING('1',1000)), (2, PADSTRING('2',1000));
+insert into aborttest values (3, PADSTRING('3',1000)), (4, PADSTRING('4',1000)), (5, PADSTRING('5',1000));
+insert into aborttest values  (6, PADSTRING('6',1000)), (7, PADSTRING('7',1000)), (8, PADSTRING('8',1000)), (9, PADSTRING('9',1000));
+
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+create index idx on aborttest (keycol, data);
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+commit;
+
+delete from aborttest where keycol < 3;
+
+-- check to make sure we have a X row locks and IX table lock;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+delete from aborttest where keycol >= 3 ;
+
+-- check to make sure we escalated;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+-- now cause space reclamation on the leftmost leaf
+insert into aborttest values (-1, '-1'), (-1, '-1');
+
+-- check to make sure we escalated;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+-- Before fix to bug 4328/4330 the following rollback would cause a recovery
+-- error which would shut down the server, and cause recovery to always fail.
+-- The problem was that the lock escalation bug would remove locks on 
+-- uncommitted deleted rows, and then the above insert would try and succeed
+-- at purging rows that it should not have been able.  When undo comes along to
+-- undo the delete it can't find the row because it has been purged by a
+-- committed nested internal transaction.
+rollback;
+
+select count(*) from aborttest;
+select keycol from aborttest;
+
+commit;
+
+
+-- TEST 4 - (beetle 4764) make sure no lock timeout if escalate is blocked by 
+-- another user.
+-- 
+connect 'wombat' as block_escalate_connection;
+set connection block_escalate_connection;
+autocommit off;
+drop table foo;
+create table foo (a int, data char(10));
+commit;
+insert into foo values (1, 'blocker');
+
+connect 'wombat' as escalate_connection;
+set connection escalate_connection;
+autocommit off;
+commit;
+
+-- insert 100 rows which should try to escalate the lock but then fail, because
+-- it is blocked by the block_escalate_connection
+insert into foo values (0, '0'), (0, '1'), (0, '2'), (0, '3'), (0, '4'), (0, '5'), (0, '6'), (0, '7'), (0, '8'), (0, '9');
+insert into foo values (10, '0'), (11, '1'), (12, '2'), (13, '3'), (14, '4'), (15, '5'), (16, '6'), (17, '7'), (18, '8'), (19, '9');
+insert into foo values (20, '0'), (21, '1'), (22, '2'), (23, '3'), (24, '4'), (25, '5'), (26, '6'), (27, '7'), (28, '8'), (29, '9');
+insert into foo values (30, '0'), (31, '1'), (32, '2'), (33, '3'), (34, '4'), (35, '5'), (36, '6'), (37, '7'), (38, '8'), (39, '9');
+insert into foo values (40, '0'), (41, '1'), (42, '2'), (43, '3'), (44, '4'), (45, '5'), (46, '6'), (47, '7'), (48, '8'), (49, '9');
+insert into foo values (50, '0'), (51, '1'), (52, '2'), (53, '3'), (54, '4'), (55, '5'), (56, '6'), (57, '7'), (58, '8'), (59, '9');
+insert into foo values (60, '0'), (61, '1'), (62, '2'), (63, '3'), (64, '4'), (65, '5'), (66, '6'), (67, '7'), (68, '8'), (69, '9');
+insert into foo values (70, '0'), (71, '1'), (72, '2'), (73, '3'), (74, '4'), (75, '5'), (76, '6'), (77, '7'), (78, '8'), (79, '9');
+insert into foo values (80, '0'), (81, '1'), (82, '2'), (83, '3'), (84, '4'), (85, '5'), (86, '6'), (87, '7'), (88, '8'), (89, '9');
+insert into foo values (90, '0'), (91, '1'), (92, '2'), (93, '3'), (94, '4'), (95, '5'), (96, '6'), (97, '7'), (98, '8'), (99, '9');
+insert into foo values (100, '0'), (101, '1'), (102, '2'), (103, '3'), (104, '4'), (105, '5'), (106, '6'), (107, '7'), (108, '8'), (109, '9');
+
+-- check to make sure we have not escalated;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+set connection block_escalate_connection;
+commit;
+
+-- see if all the data made it.
+select a, data from foo;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,16 @@
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+#
+ij.protocol=jdbc:derby:
+database=jdbc:derby:wombat;create=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/EscalateLock_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+#derby.storage.pageCacheSize=400
+#derby.debug.true=LogTrace
+derby.infolog.append=true
+derby.locks.escalationThreshold=100

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,286 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.backupRestore1
+
+   Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+
+import java.io.File;
+import java.io.ByteArrayInputStream;
+import java.io.RandomAccessFile;
+import java.math.BigDecimal;
+
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test of backup restore through java program JDBC calls.
+ * Enhanced the test from bug5229 repro.
+ * @author suresht
+ */
+
+public class backupRestore1
+{
+    private static final byte[] blob1 = { 1, 2, 3, 4, 5, 6, 7, 8};
+    private static final byte[] blob2 = new byte[0x4001];
+    private static final byte[] blob3 = new byte[0x8000];
+    private static final byte[] blob4 = new byte[32700];
+    private static final byte[] clob1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
+    private static final byte[] clob2 = new byte[0x4001];
+    private static final byte[] clob3 = new byte[0x8000];
+    private static final byte[] clob4 = new byte[0x1000];
+    static
+    {
+        for( int i = 0; i < clob2.length; i++)
+            clob2[i] = 'a';
+        for( int i = 0; i < clob3.length; i++)
+            clob3[i] = 'b';
+        for( int i = 0; i < clob4.length; i++)
+            clob4[i] = 'c';
+    }
+
+    public static void main( String args[])
+    {
+
+		System.out.println("Test backupRestore starting");
+        try
+        {
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			Connection conn = ij.startJBMS();
+            Statement stmt = conn.createStatement();
+			stmt.execute("CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker' LANGUAGE JAVA PARAMETER STYLE JAVA");
+
+            stmt.executeUpdate( "create table t( id integer not null primary key, cBlob blob(64K),"
+                + "cClob clob(64K), clvarchar long varchar, clvarbinary long varchar for bit data)");
+            conn.setAutoCommit( false);
+            PreparedStatement insStmt = conn.prepareStatement( "insert into t( id, cBlob, cClob, clvarchar, clvarbinary) values( ?, ?, ?, ?, ?)");
+            insStmt.setInt( 1, 1);
+            insStmt.setBinaryStream( 2, new ByteArrayInputStream( blob1), blob1.length);
+            insStmt.setAsciiStream( 3, new ByteArrayInputStream( clob1), clob1.length);
+            insStmt.setAsciiStream( 4, new ByteArrayInputStream( clob2), clob2.length);
+            insStmt.setBinaryStream( 5, new ByteArrayInputStream( blob2), blob2.length);
+            insStmt.executeUpdate();
+            insStmt.setInt( 1, 2);
+            insStmt.setBinaryStream( 2, new ByteArrayInputStream(blob3), blob3.length);
+            insStmt.setAsciiStream( 3, new ByteArrayInputStream( clob3), clob3.length);
+            insStmt.setAsciiStream( 4, new ByteArrayInputStream( clob4), clob4.length);
+            insStmt.setBinaryStream( 5, new ByteArrayInputStream( blob4), blob4.length);
+            insStmt.executeUpdate();
+            conn.commit();
+
+			//execute the backup command.
+            CallableStatement backupStmt = conn.prepareCall(
+                "CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(?, ?)");
+            backupStmt.setString(1, "extinout/mybackup");
+            backupStmt.setInt(2, 1);
+            backupStmt.execute();
+            backupStmt.close();
+
+			//insert a row after the bacup
+            insStmt.setInt( 1, 3);
+            insStmt.setBinaryStream( 2, new ByteArrayInputStream(blob3), blob3.length);
+            insStmt.setAsciiStream( 3, new ByteArrayInputStream( clob3), clob3.length);
+            insStmt.setAsciiStream( 4, new ByteArrayInputStream( clob4), clob4.length);
+            insStmt.setBinaryStream( 5, new ByteArrayInputStream( blob4), blob4.length);
+            insStmt.executeUpdate();
+			conn.commit();
+            insStmt.close();
+            conn.close();
+        }
+        catch( SQLException e)
+        {
+			dumpSQLExceptions(e);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		//shutdown the database ..
+		try{
+			//shutdown 
+			Connection conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+		}catch(SQLException se){
+				if (se.getSQLState() != null && se.getSQLState().equals("08006"))
+					System.out.println("database shutdown properly");
+				else
+					dumpSQLExceptions(se);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		System.out.println("testing rollforward recovery");
+		try{
+			//perform rollforward recovery and do some inserts again
+			Connection conn = DriverManager.getConnection(
+														  "jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat");
+			//run consistenct checker
+			Statement stmt = conn.createStatement();
+			stmt.execute("VALUES (ConsistencyChecker())");
+
+			//make sure the db has three rows
+			ResultSet rs = stmt.executeQuery("select count(*) from t");
+			while (rs.next()) {
+				int count = rs.getInt(1);
+				System.out.println(count);
+			}
+
+            conn.commit();
+			conn.close();
+			conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+		}
+        catch( SQLException se)
+        {
+			if (se.getSQLState() != null && se.getSQLState().equals("08006"))
+				System.out.println("database shutdown properly");
+			else
+				dumpSQLExceptions(se);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		
+		//make sure that good back does not get deleted if renaming existing
+		//backup as old backup fails. (beetle : 5336)
+		RandomAccessFile rfs = null;
+		boolean alreadyShutdown = false;
+		try{
+			Connection conn = DriverManager.getConnection("jdbc:derby:wombat");
+					
+			//just open to a file in existing backup, so that rename will fail on
+			//next backup
+			rfs = 
+                new RandomAccessFile(
+                    "extinout/mybackup/wombat/service.properties" , "r");
+
+            CallableStatement backupStmt = conn.prepareCall(
+                "CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(?)");
+            backupStmt.setString(1, "extinout/mybackup");
+            backupStmt.execute();
+            backupStmt.close();
+			conn.close();
+
+			conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+		}catch(SQLException se)
+		{
+			if (se.getSQLState() != null && se.getSQLState().equals("XSRS4"))
+			{	alreadyShutdown = false;
+				//expected exception:XSRS4;rename failed because of a open file
+			}else	
+				if (se.getSQLState() != null &&
+					se.getSQLState().equals("08006"))
+				{	//On UNIX Systems , rename does not fail even if there is a
+					//open file, if we succefully reached shutdown mean
+					//everything is okay.
+					System.out.println("database shutdown properly");
+					alreadyShutdown = true;
+				}else
+					dumpSQLExceptions(se);
+		}catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		//shutdown the db
+		if(!alreadyShutdown)
+		{
+			try{
+				//shutdown 
+				Connection conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+			}catch(SQLException se){
+				if (se.getSQLState() != null && se.getSQLState().equals("08006"))
+					System.out.println("database shutdown properly");
+				else
+					dumpSQLExceptions(se);
+			} catch (Throwable e) {
+				System.out.println("FAIL -- unexpected exception:" + e.toString());
+			}
+		}
+
+		//restore from the backup db and run consistency checker on it.
+		try{
+			//close the earlier opened file in backup dir
+			if(rfs != null )
+				rfs.close();
+			Connection conn = DriverManager.getConnection("jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat");
+			//run consistenct checker
+			Statement stmt = conn.createStatement();
+			stmt.execute("VALUES (ConsistencyChecker())");
+			conn.close();
+			//shutdown the backup db;
+			conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+		}catch(SQLException se)
+		{
+			if (se.getSQLState() != null && se.getSQLState().equals("08006"))
+				System.out.println("database shutdown properly");
+			else
+				dumpSQLExceptions(se);
+		}catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		//now take a backup again , just to make all is well in the system.
+		try{
+			Connection conn = DriverManager.getConnection("jdbc:derby:wombat");
+
+            CallableStatement backupStmt = conn.prepareCall(
+                "CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(?)");
+            backupStmt.setString(1, "extinout/mybackup");
+            backupStmt.execute();
+            backupStmt.close();
+
+			Statement stmt = conn.createStatement();
+			stmt.execute("VALUES (ConsistencyChecker())");
+			conn.close();
+			conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+		}catch(SQLException se)
+		{
+			if (se.getSQLState() != null && se.getSQLState().equals("08006"))
+				System.out.println("database shutdown properly");
+			else
+				dumpSQLExceptions(se);
+		}catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+
+		System.out.println("Test backupRestore1 finished");
+    }
+
+	
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception: " + se.toString());
+        SQLException lastSe = se;
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+            lastSe = se;
+			se = se.getNextException();
+		}
+		System.out.println("");
+        lastSe.printStackTrace(System.out);
+	}
+    
+}        
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,17 @@
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+#
+ij.protocol=jdbc:derby:
+database=jdbc:derby:wombat;create=true;logDevice=extinout/br1logDir
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+usedefaults=true
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,118 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.bootLock
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.RandomAccessFile;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ *Testing for FileLocks that prevent Derby Double Boot.
+ * @author suresht
+ */
+
+public class bootLock { 
+	public static void main(String[] args) {
+		Connection con;
+		Statement stmt;
+
+		try
+		{
+
+			System.out.println("Test BootLock Starting");
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			String derbyHome = System.getProperty("derby.system.home");
+			con = ij.startJBMS();
+
+			stmt = con.createStatement();
+			stmt.execute("create table t1 (a int)");
+			stmt.close();
+			con.close();
+			try{
+				con = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+			}catch(Exception e)
+			{
+				//Shutdown will throw exception , just ignore it.	
+			}
+
+			//Invoke anothe jvm that makes a connection to database wombat
+
+			String cmd = "java org.apache.derbyTesting.functionTests.tests.store.bootLock1";
+			Runtime rtime = Runtime.getRuntime();
+			Process p1 = rtime.exec(cmd, (String[])null, new File(derbyHome));
+			
+			//sleep for some with the hope that other jvm has made the
+			//connection.
+
+			Thread.sleep(30000);
+
+			//Now if we try to boot , we should get an multiple 
+			//instance exception
+			try{
+				con = DriverManager.getConnection("jdbc:derby:wombat");
+			}catch(SQLException e) {
+				System.out.println("expected exception");
+				dumpSQLExceptions(e);
+			}
+
+			//kill the sub process
+			p1.destroy();
+
+		}		
+		catch (SQLException e) {
+			System.out.println("FAIL -- unexpected exception");
+			dumpSQLExceptions(e);
+			e.printStackTrace();
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception: "+e);
+			e.printStackTrace();
+		}
+
+		System.out.println("Test BootLock finished");
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): ");
+			se = se.getNextException();
+		}
+	}
+}
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock1.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock1.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock1.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,81 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.bootLock1
+
+   Copyright 2002, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ *Just make a connection to wombat , 
+ * Used by bootLock.java to invoke a different jvm and make a connection to wombat 
+ * @author suresht
+ */
+
+public class bootLock1 { 
+	public static void main(String[] args) {
+		Connection con;
+		Statement stmt;
+
+		try
+		{
+
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+			con = DriverManager.getConnection("jdbc:derby:wombat");
+			//infinite loop until it gets killed.
+			for(;;)
+			{
+				Thread.sleep(30000);
+			}
+		}		
+		catch (SQLException e) {
+			//			System.out.println("FAIL -- unexpected exception");
+			//dumpSQLExceptions(e);
+			//e.printStackTrace();
+		}
+		catch (Throwable e) {
+			//System.out.println("FAIL -- unexpected exception: "+e);
+			//e.printStackTrace();
+		}
+
+    }
+
+	static private void dumpSQLExceptions (SQLException se) {
+		while (se != null) {
+			System.out.println("SQLSTATE("+se.getSQLState()+"): ");
+			se = se.getNextException();
+		}
+	}
+}
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,13 @@
+#
+# default settings:
+database=jdbc:derby:wombat;create=true
+derby.optimizer.noTimeout=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+
+ij.defaultResourcePackage=/org/apache/derbyTesting/functionTests/tests/store/
+# test specific settings:
+runwithj9=false
+runwithibm13=false
+runwithjdk13=false

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml	Tue Jan 11 11:53:57 2005
@@ -42,11 +42,48 @@
 
 <!--             ============ Begin Targets ==============                -->
  
-  <target name="FTOtestsubdir" depends="copyfiles"/>
+  <target name="FTOtestsubdir" depends="compile,copyfiles"/>
 
   <!-- mkdir / init target should not be necessary, just here for reference... -->
   <target name="init">
     <mkdir dir="${out.dir}/${derby.testing.functest.dir}/tests/store"/>
+  </target>
+  <target name="compile">
+    <javac
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}" 
+      srcdir="${derby.testing.src.dir}"
+      destdir="${out.dir}">
+      <classpath>
+        <!--pathelement location="${oro}"/-->
+        <pathelement path="${compile.classpath}"/>
+      </classpath>
+      <include name="${this.dir}/*.java"/>
+      <exclude name="${this.dir}/bootLock.java"/>
+    </javac>
+    <javac
+      bootclasspath="${empty}"
+      nowarn="on"
+      debug="${debug}"
+      depend="${depend}"
+      deprecation="${deprecation}"
+      optimize="${optimize}"
+      proceed="${proceed}"
+      verbose="${verbose}" 
+      srcdir="${derby.testing.src.dir}"
+      destdir="${out.dir}">
+      <classpath>
+        <!--pathelement location="${oro}"/-->
+        <pathelement path="${java14compile.classpath}"/>
+      </classpath>
+      <include name="${this.dir}/bootLock.java"/>
+    </javac>
   </target>
 
   <target name="copyfiles">

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675.data
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675.data?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675.data	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901aaa
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675trailingblanks.data
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675trailingblanks.data?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32675trailingblanks.data	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901   
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703.data
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703.data?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703.data	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789aaa
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703trailingblanks.data
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703trailingblanks.data?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/char32703trailingblanks.data	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789   
\ No newline at end of file

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,237 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.checkPoint
+
+   Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+import java.io.File;
+import java.io.ByteArrayInputStream;
+
+import java.math.BigDecimal;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * Test to make sure checkpoint or occuring as expected.
+ * Check is done by looking at the timestamp for "log.ctrl" file,
+ * If modified time is more than what it was in the last lookup
+ * means , we know that checkpoint occured.
+ * Other thing that is counted is in this program is number of log switches.
+ * @author suresht
+ */
+
+public class checkPoint
+{
+ 
+    public static void main( String args[])
+    {
+		System.out.println("Test checkpoint starting");
+		
+        try
+        {
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			Connection conn = ij.startJBMS();
+
+			//open all the internal derby files involved in this test.
+			setupAllTestFiles();
+
+            Statement stmt = conn.createStatement();
+			stmt.executeUpdate("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");
+
+            stmt.executeUpdate( "create table t1(" + 
+								"c1 int not null primary key , c2 varchar(200) not null unique , c3 char(200) not null unique)");
+            conn.setAutoCommit(true);
+			String  ins_string = "insert into t1 values(?,?,?)";
+			PreparedStatement insStmt = conn.prepareStatement(ins_string);
+			//wait to make sure that checkpoint thread finished it's work
+			stmt.executeUpdate("CALL SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE()");
+			stmt.executeUpdate("call WAIT_FOR_POST_COMMIT()");
+			checkpointOccured();
+			boolean modifiedIntervals = false;
+			for(int uniqueid =0 ; uniqueid < 3500 ; uniqueid++)
+			{
+				insStmt.setLong(1, uniqueid);
+				insStmt.setString(2, "IBM GREAT COMPANY " + uniqueid);
+				insStmt.setString(3, "IBM GREAT COMPANY " + uniqueid);
+				insStmt.executeUpdate();
+				
+				//check every 300 rows inserted  how many log files
+				//are there and whether a  checkpoint occured
+				if((uniqueid % 400) == 0)
+				{
+					System.out.println("Checking logs and Checkpoint at Insert:"
+									   + uniqueid);
+					//wait to make sure that checkpoint thread finished it's work
+					stmt.executeUpdate("call WAIT_FOR_POST_COMMIT()");
+					checkpointOccured();
+				}
+
+				//change the checkpointInterval and LogInterval to equal values
+				if(uniqueid > 2500 && !modifiedIntervals)
+				{
+					ResultSet rs;
+					System.out.println("Modifying the checkpoint/log intervals");
+					//modify the values.
+					String value = "150001";
+					stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY" +
+									   "('derby.storage.logSwitchInterval', " +
+									   "'" + value + "'"+ ")");
+					stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY" +
+									   "('derby.storage.checkpointInterval', " +
+									   "'" + value + "'" + ")");
+					rs	= 
+						stmt.executeQuery("values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY" +
+										  "('derby.storage.checkpointInterval')");
+					while(rs.next()){
+						System.out.println("checkPointInterval:" + rs.getString(1));
+					}
+					
+					rs =stmt.executeQuery("values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY" +
+										  "('derby.storage.logSwitchInterval')");
+					while(rs.next()){
+						System.out.println("logSwitchInterval:" + rs.getString(1));
+					}
+
+					modifiedIntervals = true;
+				}
+			}
+			
+			//print the number of the last log file
+			//to make sure we are creating too many log files.
+			numberOfLogFiles();
+			conn.commit();
+			stmt.close();
+            insStmt.close();
+            conn.close();
+        }
+        catch( SQLException e)
+        {
+			dumpSQLExceptions(e);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		//shutdown the database ..
+		try{
+			//shutdown 
+			Connection conn = DriverManager.getConnection("jdbc:derby:wombat;shutdown=true");
+		}catch(SQLException se){
+				if (se.getSQLState() != null && se.getSQLState().equals("08006"))
+					System.out.println("database shutdown properly\n");
+				else
+					dumpSQLExceptions(se);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		System.out.println("Test checkpoint finished");
+    }
+
+	
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception: " + se.toString());
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se = se.getNextException();
+		}
+	}
+
+
+
+	//utility routines to trach number of log files
+	//and checkpoints.
+	private static String derbyHome;
+	private static File dbDir ;
+	private static File logDir;
+	private static File logControlFile;
+	private static long lastCheckPointTime = 0;
+
+	private static void setupAllTestFiles()
+	{
+		derbyHome = System.getProperty("derby.system.home");
+		dbDir = new File(derbyHome, "wombat");
+		logDir = new File(dbDir , "log");
+		logControlFile = new File(logDir , "log.ctrl");
+		lastCheckPointTime = logControlFile.lastModified();
+	}
+
+	private static boolean checkpointOccured()
+	{
+		long currentModifiedTime = logControlFile.lastModified();
+		if(currentModifiedTime > lastCheckPointTime)
+		{
+			lastCheckPointTime = currentModifiedTime ;
+			System.out.println("CHECKPOINT WAS DONE");
+			return true;
+		}
+		
+		return false;
+	}
+
+
+	private static int numberOfLogFiles()
+	{
+		//find out how many log files are in logDir
+		//-2 (control files log.ctrl, logmirror.ctrl)
+		File[] logFiles = logDir.listFiles();
+		int noFiles = (logFiles == null) ? 0 : logFiles.length;
+		String lastLogFile ="";
+		for(int i = 0 ; i < noFiles ; i++)
+		{
+			String current = logFiles[i].getName() ;
+			if(current.compareTo("log.ctrl")==0 || current.compareTo("logmirror.ctrl")==0)
+				continue;
+			if(current.compareTo(lastLogFile) > 0)
+				lastLogFile = current;
+		}
+
+		if(lastLogFile.compareTo("log21.dat") > 0)
+		{
+			System.out.println("There seems to be too many log files");
+			System.out.println(lastLogFile);
+		}
+		logFiles = null;
+		return noFiles -2 ;
+
+
+	}
+    
+}        
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/checkPoint_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+# this test failed with "out of memory" on jdk118 with default 1000 page cache.
+#derby.storage.pageCacheSize=40
+derby.storage.logSwitchInterval=300000
+derby.storage.checkpointInterval=1200000

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant	Tue Jan 11 11:53:57 2005
@@ -1,3 +1,7 @@
+Beetle6038_app.properties
+EscalateLock.sql
+EscalateLock_app.properties
+EscalateLock_derby.properties
 LockTableQuery.subsql
 Rllmodule1.sql
 Rllmodule1_derby.properties
@@ -24,9 +28,12 @@
 access_derby.properties
 backupRestore.sql
 backupRestore_app.properties
+backupRestore1_app.properties
+bootLock_app.properties
 brtestjar.jar
 bug3498.sql
 bug3498_app.properties
+checkPoint_derby.properties
 cisco.sql
 cisco.subsql
 cisco_app.properties
@@ -37,6 +44,7 @@
 connectDisconnect_derby.properties
 copyfiles.ant
 createTestProcedures.subsql
+databaseProperties.sql
 default_app.properties
 default_derby.properties
 global_xactTable.view
@@ -55,6 +63,14 @@
 longColumn_derby.properties
 longRow.sql
 madhare.sql
+readBtreeCursorLocks.subsql
+readBtreeSetLocks.subsql
+readCursorLocks.subsql
+readSetLocks.subsql
+readlocks.sql
+readUncommitted.sql
+readUncommitted_app.properties
+readUncommitted_derby.properties
 removeStubs.sql
 rlliso1multi.sql
 rlliso1multi.subsql
@@ -66,11 +82,33 @@
 rlliso3multi.sql
 rlliso3multi_app.properties
 rlliso3multi_derby.properties
+rollForwardBackup.sql
+rollForwardBackup_app.properties
+rollForwardBackup_sed.properties
 rollForwardRecovery.sql
 rollForwardRecovery_app.properties
 rollForwardRecovery_derby.properties
+streamingColumn_app.properties
+streamingColumn_derby.properties
+derby.banner
+shortbanner
+char32675.data
+char32675trailingblanks.data
+char32703.data
+char32703trailingblanks.data
+empty.data
+short.data
 testsqldecimal.sql
 testsqldecimal_derby.properties
+updatecursorlocks.subsql
+updateholdcursorlocksJDBC30.subsql
+updatelocks.sql
+updatelocksJDBC30.sql
+updatelocksJDBC30_app.properties
+updatesetlocks.subsql
+updateBtreeCursorLocks.subsql
+updateBtreeHoldCursorLocksJDBC30.subsql
+updateBtreeSetLocks.subsql
 xaOffline1.sql
 xaOffline1_derby.properties
 xaOffline1_sed.properties

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,124 @@
+run resource '/org/apache/derbyTesting/functionTests/util/testRoutines.sql';
+CREATE FUNCTION GET_TABLE_PROPERTY (SCHEMA_NAME VARCHAR(128), TABLE_NAME VARCHAR(128), PROP_KEY VARCHAR(1000)) RETURNS VARCHAR(1000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestPropertyInfo.getTableProperty' LANGUAGE JAVA PARAMETER STYLE JAVA;
+
+
+-- Get a property that hasn't been set yet - should return null
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key1');
+
+-- Set a couple of properties
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('key1', 'one, two, three');
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('key2', 'eins, zwei, drei');
+
+-- and fetch them
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key1');
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key2');
+
+
+-- and delete one of theme
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('key2', null);
+
+-- and fetch them
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key1');
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('key2');
+
+
+-- Now check some explicit properties
+
+-- ************ derby.storage.pageSize
+
+-- See what the default is first
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+drop table T;
+
+-- set the per-database value
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '16384');
+
+-- this create table should pick up the per-database
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+drop table T;
+
+
+-- ************ derby.storage.minimumRecordSize
+
+-- See what the default is first
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.minimumRecordSize');
+drop table T;
+
+-- set the per-database value
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', '42');
+
+-- this create table should pick up the per-database
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.minimumRecordSize');
+drop table T;
+
+
+-- ************ derby.storage.pageReservedSpace
+
+-- See what the default is first
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageReservedSpace');
+drop table T;
+
+-- set the per-database value
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace', '17');
+
+-- this create table should pick up the per-database
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageReservedSpace');
+drop table T;
+
+
+
+
+-- ************ derby.database.noAutoBoot
+-- should be set in service.properties, not the conglomerate, but that's transparent here ... 
+
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.noAutoBoot', 'true');
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+
+
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.noAutoBoot', 'false');
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.noAutoBoot', null);
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.database.noAutoBoot');
+-- Now check some explicit properties
+
+
+-- Now check with derby.storage.pageSize if derby.database.propertiesOnly
+-- ensures that system wide properties are ignored
+
+-- See is currently set, should be 16384
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+
+drop table T;
+
+-- set system value
+CALL TESTROUTINE.SET_SYSTEM_PROPERTY('derby.storage.pageSize', '8192');
+
+-- this create table should pick up the system value - 8192
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+drop table T;
+
+-- 
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.database.propertiesOnly', 'true');
+
+
+-- this create table should pick up the database value - 16384
+create table T (i int);
+values GET_TABLE_PROPERTY('APP', 'T', 'derby.storage.pageSize');
+drop table T;
+
+-- verify that creation time only properties may not be set.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.engineType', '9');
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.engineType');
+
+drop function GET_TABLE_PROPERTY;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/derby.banner
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/derby.banner?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/derby.banner	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,9000 @@
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/empty.data
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/empty.data?view=auto&rev=124918
==============================================================================

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeCursorLocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeCursorLocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeCursorLocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,547 @@
+-- Very basic single user testing of read locks on cursors on indexes.
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+-- TEST  0: btree cursor scan, group fetch = 1
+-- TEST  1: btree cursor scan, group fetch = 2
+-- TEST  2: btree cursor scan, group fetch = 1 stop scan in middle of set
+-- TEST  3: btree cursor scan, group fetch = 4 stop scan in middle of set
+-- TEST  4: btree cursor scan, group fetch = 1 (scan with some deleted rows)
+-- TEST  5: btree cursor scan, group fetch = 2(scan with committed deleted rows)
+-- TEST  6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST  7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST  8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST  9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: btree cursor scan, group fetch = 1 ("=" qualifier, no rows return)
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 0: btree cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+-------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 1: btree cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 2: btree cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 3: btree cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 4: btree cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+commit;
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 5: btree cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a';
+
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 6: btree cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a where a < 3';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 7: btree cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a where a < 3';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 8: btree cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a where a = 5';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 9: btree cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a where a = 5 or a = 7';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 10: btree cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, held until end xact
+--    REPEATABLE READ  - row S locks as it visits each row, held until end xact
+--    READ COMMITTED   - row S lock on current row, released on move to next row
+--    READ UNCOMMITTED - no row locks.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+-- no rows expected to qualify
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a from a where a = 42';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeSetLocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeSetLocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readBtreeSetLocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,164 @@
+-- Basic single user testing of read locks on select "set" queries on indexes.
+--
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+-- TEST 0: btree scan
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- TEST 4: btree scan, (equals qualifier, no rows return)
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, and index with following initial values:
+--     create table a (a int, b int, c somesortofchar, [index_pad]);
+--     create index a_idx on a (a) or a_idx on a (a, index_pad);
+--
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 0: btree scan
+-- Test full scan.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--------------------------------------------------------------------------------
+select a from a;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- TEST 1: btree scan, (scan table with some deleted rows)
+-- Test full scan on a data set with some deleted rows (the "even" ones).
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- After the delete the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+commit;
+
+select a from a;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- TEST 2: btree scan, (scan with "<" qualifier)
+-- Test "less than" qualified scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select a from a where a < 3;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 3: btree scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select a from a where a = 5;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST  4: btree scan, (equals qualifier, no rows return)
+-- Test "equals" qualified scan on a data set, no rows returned.
+--    ALL MODES        - TABLE IS, "scan page lockname of form (pageno, 1) 
+--    SERIALIZABLE     - row S locks as it visits each row, row/table lock 
+--                       held until end xact.  Also holds one previous key lock.
+--    REPEATABLE READ  - row S locks as it visits each row, row/table locks held
+--                       until end of transaction.
+--    READ COMMITTED   - instantaneous S locks requested on each row.  No locks
+--                       held after query finishes.
+--    READ UNCOMMITTED - no row locks.  No locks held after query finishes.
+--
+-- At this point the base table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+-- no rows expected to qualify
+select a from a where a = 42;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readCursorLocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readCursorLocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readCursorLocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,507 @@
+-- Very basic single user testing of read locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+-- TEST 0: heap cursor scan, group fetch = 1
+-- TEST 1: heap cursor scan, group fetch = 2
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 0: heap cursor scan, group fetch = 1
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+get cursor scan_cursor as
+    'select a, b, c from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 1: heap cursor scan, group fetch = 2
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c from a' to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 2: heap cursor scan, group fetch = 1, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c from a' to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 3: heap cursor scan, group fetch = 4, stop scan in middle of set
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row.
+--    READ COMMITTED   - TABLE IS, will hold single S lock on current row.
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','4');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c from a' to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 4: heap cursor scan, group fetch = 1 (scan table with some deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+commit;
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c from a' to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 5: heap cursor scan, group fetch = 2 (scan with committed deleted rows)
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b, c from a' to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 6: heap cursor scan, group fetch = 1 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 7: heap cursor scan, group fetch = 2 (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a where a < 3';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 8: heap cursor scan, group fetch = 1 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+get cursor scan_cursor as
+    'select a, b, c from a where a = 5';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 9: heap cursor scan, group fetch = 2 (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 10: heap cursor scan, group fetch = 1 (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                        (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the statement to be recompiled
+create index ix1 on a(a);
+drop index ix1;
+commit;
+
+get cursor scan_cursor as
+    'select a, b, c from a where a = 7';
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readSetLocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readSetLocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readSetLocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,160 @@
+-- Very basic single user testing of read locks in "set" queries on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+-- TEST  0: heap scan.
+-- TEST  1: heap scan, some rows deleted.
+-- TEST  2: heap scan, (scan with "<" qualifier)
+-- TEST  3: heap scan, (scan with equals qualifier)
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 0: heap scan.
+-- Test full cursor scan which does no updates.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--------------------------------------------------------------------------------
+
+select a, b, c from a;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- TEST 1: heap scan, some rows deleted.
+-- Test full cursor scan on a data set with some deleted rows (the "even" ones).
+--    SERIALIZABLE     - will get table level S lock.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release
+--    READ UNCOMMITTED - TABLE IS, no row locks.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- After the delete the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+commit;
+
+select a, b, c from a;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- TEST 2: heap scan, (scan with "<" qualifier)
+-- Test "less than" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select a, b, c from a;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- TEST 3: heap scan, (scan with equals qualifier)
+-- Test "equals" qualified cursor scan on a data set.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select a, b, c from a where a = 5;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- TEST  4: heap scan, (equals qualifier, no rows return)
+-- Test "equals" qualified cursor scan on a data set, no rows returned.
+--    SERIALIZABLE     - will get table level S lock, held to end of xact.
+--    REPEATABLE READ  - TABLE IS, will get row S locks as it visits each row 
+--                         (including deleted ones).  held to end of xact.
+--    READ COMMITTED   - TABLE IS, will get instantaneous locks and release. No
+--                         locks held when statement completes.
+--    READ UNCOMMITTED - TABLE IS, no row locks.  No locks after statement ends.
+--
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select a, b, c from a where a = 7;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,166 @@
+------------------------------------------------------------------------------
+-- TEST CASES SPECIFIC TO STORE IMPLEMENTATION OF READ UNCOMMITTED:
+-- overview:
+--    TEST 0: Test a scan positioned on a row which is deleted from it.
+--    TEST 1: Test a scan positioned on a row which is purged from it.
+------------------------------------------------------------------------------
+--
+------------------------------------------------------------------------------
+run resource 'createTestProcedures.subsql';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+connect 'wombat' as scanner;
+
+autocommit off;
+
+connect 'wombat' as deleter;
+autocommit off;
+
+------------------------------------------------------------------------------
+-- TEST 0: Test a scan positioned on a row which is deleted from it.
+------------------------------------------------------------------------------
+
+set connection scanner;
+set current isolation to UR;
+drop table data;
+
+-- create a table with 2 rows per index page.
+create table data (keycol int, data varchar(1600)) ;
+insert into data values (0, PADSTRING('0',1600));
+insert into data values (10, PADSTRING('100',1600));
+insert into data values (20, PADSTRING('200',1600));
+insert into data values (30, PADSTRING('300',1600));
+insert into data values (40, PADSTRING('400',1600));
+insert into data values (50, PADSTRING('100',1600));
+insert into data values (60, PADSTRING('200',1600));
+insert into data values (70, PADSTRING('300',1600));
+insert into data values (80, PADSTRING('400',1600));
+create index idx on data (keycol, data) ;
+commit;
+
+set connection deleter;
+SET ISOLATION READ COMMITTED;
+commit;
+
+-- position scanner with no bulk fetch on 40,400
+
+set connection scanner;
+
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+get cursor scan_cursor as
+    'select keycol from data';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+next scan_cursor;
+next scan_cursor;
+next scan_cursor;
+next scan_cursor;
+next scan_cursor;
+
+-- now delete all the rows except for 70 and 80
+set connection deleter;
+delete from data where keycol < 70;
+
+-- scanner should automatically jump to 70
+set connection scanner;
+next scan_cursor;
+
+-- cleanup
+close scan_cursor;
+commit;
+
+set connection deleter;
+commit;
+
+------------------------------------------------------------------------------
+-- TEST 1: Test a scan positioned on a row which is purged.
+------------------------------------------------------------------------------
+
+set connection scanner;
+set isolation read uncommitted;
+drop table data;
+
+-- create a table with 3 rows per index page.
+create table data (keycol int, data varchar(1200));
+insert into data values (0, PADSTRING('0',1200));
+insert into data values (10, PADSTRING('100',1200));
+insert into data values (20, PADSTRING('200',1200));
+insert into data values (30, PADSTRING('300',1200));
+insert into data values (40, PADSTRING('400',1200));
+insert into data values (50, PADSTRING('100',1200));
+insert into data values (60, PADSTRING('200',1200));
+insert into data values (70, PADSTRING('300',1200));
+insert into data values (80, PADSTRING('400',1200));
+create index idx on data (keycol, data) ;
+commit;
+
+-- position scanner with no bulk fetch on 0,0 (first row in btree)
+
+set connection scanner;
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+get cursor scan_cursor as
+    'select keycol from data';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+next scan_cursor;
+
+
+-- delete all the rows in the table except for the last few pages, and the 1st;
+set connection deleter;
+delete from data where keycol < 50 and keycol > 0;
+
+-- insert enough rows after the first to force a split by the scanner on the 1st
+-- page, it will now be positioned by key on the (0, 0) key.   Then delete the
+-- rows that we just inserted.
+set connection scanner;
+insert into data values (9, '3'), (9, '2'), (9, '1');
+delete from data where keycol = 9;
+
+-- delete the key that the scan is positioned on.  
+set connection deleter;
+delete from data where keycol = 0;
+commit;
+
+set connection scanner;
+-- this should now cause another split on the first page in the btree, this
+-- time it should reclaim row 0.
+insert into data values (8, '3'), (8, '2'), (8, '1');
+
+-- scanner should automatically jump to 8, handling the fact that row (0,0)
+-- no longer exists in the table.
+set connection scanner;
+next scan_cursor;
+next scan_cursor;
+next scan_cursor;
+next scan_cursor;
+
+-- delete all the rows that remain except the last;
+set connection deleter;
+delete from data where keycol > 10 and keycol < 80;
+commit;
+
+-- position scan on last row of scan.
+set connection scanner;
+next scan_cursor;
+
+-- now repeat process from above to make the current scan position disappear to
+-- test code path executed when closing a scan where the last scan position has
+-- disappeared.
+set connection scanner;
+insert into data values (82, '3'), (82, '2'), (82, '1');
+delete from data where keycol = 81;
+set connection deleter;
+delete from data where keycol = 80;
+commit;
+set connection scanner;
+-- this statement will purge (80, 800) from the table.
+insert into data values (81, '3'), (81, '2'), (81, '1');
+delete from data where keycol = 81;
+
+-- this statement will execute code which will look for last key positioned on
+-- while closing the statement.
+close scan_cursor;
+
+-- cleanup
+set connection scanner;
+commit;
+
+set connection deleter;
+commit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,24 @@
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+#
+ij.protocol=jdbc:derby:
+database=jdbc:derby:wombat;create=true
+derby.optimizer.noTimeout=true
+
+# turn the following on if you want to
+# test stored prepared statements.  will
+# run all execute immediate statements as
+# stored prepared statements
+#ij.executeAsSPS=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+ij.defaultResourcePackage=/com/ibm/db2j/functionTests/store/

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readUncommitted_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,14 @@
+derby.storage.userLockTrace=true
+derby.locks.deadlockTimeout=1
+derby.locks.waitTimeout=5
+
+#derby.infolog.append=true
+derby.language.logStatementText=true
+
+#derby.debug.true=userLockStackTrace,DeadlockTrace
+
+#derby.debug.true=DeadlockTrace
+
+#derby.debug.true=enableRowLocking,DeadlockTrace
+
+derby.debug.true=verbose_heap_post_commit

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readlocks.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readlocks.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/readlocks.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,961 @@
+-- Very basic single user testing of update row locking.
+
+autocommit off;
+run resource 'createTestProcedures.subsql';
+run resource 'LockTableQuery.subsql';
+commit;
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+
+-- READ UNCOMMITTED TEST
+set isolation read uncommitted;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+      -- to create tables of page size 4k and still keep the following tbl 
+      -- create table a (a int, b int, c varchar(1900));
+      
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one', 1900), 
+    PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two', 1900), 
+    PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three', 1900), 
+    PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four', 1900), 
+    PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five', 1900), 
+    PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six', 1900), 
+    PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven', 1900), 
+    PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+commit;
+
+-- READ COMMITTED TEST
+set isolation read committed;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+     	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+commit;
+
+-- REPEATABLE READ TEST
+set current isolation RS;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+      -- to create tables of page size 4k and still keep the following tbl 
+      -- create table a (a int, b int, c varchar(1900));
+      
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, PADSTRING('one', 1900));
+    insert into a values (2, 20, PADSTRING('two', 1900));
+    insert into a values (3, 30, PADSTRING('three', 1900));
+    insert into a values (4, 40, PADSTRING('four', 1900));
+    insert into a values (5, 50, PADSTRING('five', 1900));
+    insert into a values (6, 60, PADSTRING('six', 1900));
+    insert into a values (7, 70, PADSTRING('seven', 1900));
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);	
+    insert into a values (1, 10, PADSTRING('one', 1900));
+    insert into a values (2, 20, PADSTRING('two', 1900));
+    insert into a values (3, 30, PADSTRING('three', 1900));
+    insert into a values (4, 40, PADSTRING('four', 1900)); 
+    insert into a values (5, 50, PADSTRING('five', 1900));
+    insert into a values (6, 60, PADSTRING('six', 1900));
+    insert into a values (7, 70, PADSTRING('seven', 1900));
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one', 1900), 
+    PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two', 1900), 
+    PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three', 1900), 
+    PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four', 1900), 
+    PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five', 1900), 
+    PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six', 1900), 
+    PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven', 1900), 
+    PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+commit;
+
+
+-- SERIALIZABLE TEST
+
+set isolation serializable;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+      -- to create tables of page size 4k and still keep the following tbl 
+      -- create table a (a int, b int, c varchar(1900));
+      
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, PADSTRING('one', 1900));
+    insert into a values (2, 20, PADSTRING('two', 1900));
+    insert into a values (3, 30, PADSTRING('three', 1900));
+    insert into a values (4, 40, PADSTRING('four', 1900));
+    insert into a values (5, 50, PADSTRING('five', 1900));
+    insert into a values (6, 60, PADSTRING('six', 1900));
+    insert into a values (7, 70, PADSTRING('seven', 1900));
+    commit;
+    run resource 'readCursorLocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    	-- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, PADSTRING('one', 1900));
+    insert into a values (2, 20, PADSTRING('two', 1900));
+    insert into a values (3, 30, PADSTRING('three', 1900));
+    insert into a values (4, 40, PADSTRING('four', 1900));
+    insert into a values (5, 50, PADSTRING('five', 1900));
+    insert into a values (6, 60, PADSTRING('six', 1900));
+    insert into a values (7, 70, PADSTRING('seven', 1900));
+    commit;
+    run resource 'readSetLocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one', 1900), 
+    PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two', 1900), 
+    PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three', 1900), 
+    PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four', 1900), 
+    PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five', 1900), 
+    PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six', 1900), 
+    PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven', 1900), 
+    PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',800));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), 
+	   PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), 
+	   PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), 
+	   PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), 
+	   PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), 
+	   PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), 
+	   PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), 
+	   PADSTRING('index pad 7',900));
+
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'readBtreeSetLocks.subsql';
+
+commit;
+
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,299 @@
+
+CREATE PROCEDURE RENAME_FILE(LOCATION VARCHAR(32000), NAME VARCHAR(32000), NEW_NAME  VARCHAR(32000)) DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.FTFileUtil.renameFile' PARAMETER STYLE JAVA;
+
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+--check whether log archive mode  enabling method is working
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 0);
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+--check whether the logArchive Mode is persistent across boots
+disconnect;
+connect 'wombat;shutdown=true';
+connect 'wombat';
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+
+--check whether log archive mode  disabling method is working
+call SYSCS_UTIL.SYSCS_DISABLE_LOG_ARCHIVE_MODE(1);
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+--check whether the logArchive Mode disabling persistent across boots
+disconnect;
+connect 'wombat;shutdown=true';
+connect 'wombat';
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+-- reenable the log archive mode again to see whether the 
+-- disabling has any side effects.
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 0);
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+disconnect;
+connect 'wombat;shutdown=true';
+connect 'wombat';
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('derby.storage.logArchiveMode');
+--END OF PROPERTY ARCHIVE CHECKS
+
+---PERFORM DIFFERENT TYPES OF RESTORE
+create table t1(a int ) ;
+insert into t1 values(1) ;
+insert into t1 values(2) ;
+insert into t1 values(3 ) ;
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 0);
+insert into t1 values(4) ;
+insert into t1 values(5);
+insert into t1 values(6);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--performa rollforward recovery
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+select * from t1 ;
+insert into t1 values(7);
+insert into t1 values(8);
+insert into t1 values(9);
+--take a backup again
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+insert into t1 values(10);
+insert into t1 values(11);
+insert into t1 values(12);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--perform complete version restore
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+select * from t1 ;
+insert into t1 values(10);
+insert into t1 values(11);
+insert into t1 values(12);
+insert into t1 values(13);
+insert into t1 values(14);
+insert into t1 values(15);
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--create a new database using wombat db backup copy with a different database name
+connect 'jdbc:derby:wombat1;createFrom=extinout/mybackup/wombat';
+select * from t1;
+insert into t1 values(16);
+insert into t1 values(17);
+insert into t1 values(18);
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:wombat1;shutdown=true';
+disconnect;
+---BACKUP AND RESTORE USING LOGDEVICE.
+connect 'jdbc:derby:crwombat;createFrom=extinout/mybackup/wombat;logDevice=extinout/crwombatlog';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('crwombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),11);
+select * from t1;
+insert into t1 values(19);
+insert into t1 values(20);
+insert into t1 values(21);
+connect 'jdbc:derby:crwombat;shutdown=true';
+disconnect;
+--do a plain boot , we should have the log device specified earlier.
+connect 'jdbc:derby:crwombat';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('crwombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),11);
+
+select * from t1;
+insert into t1 values(22);
+insert into t1 values(23);
+insert into t1 values(24);
+connect 'jdbc:derby:crwombat;shutdown=true';
+disconnect;
+---check the error case of log device only existing when
+-- we try to do createFrom .
+--following connection shoul fail.
+connect 'jdbc:derby:erwombat;createFrom=extinout/mybackup/wombat;logDevice=extinout/crwombatlog';
+
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat;logDevice=extinout/wombatlog';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+
+select * from t1 ;
+insert into t1 values(19);
+insert into t1 values(20);
+insert into t1 values(21);
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--restore again from backup case to make sure
+--backups are getting the log device property.	
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+select * from t1;
+insert into t1 values(22);
+insert into t1 values(23);
+insert into t1 values(24);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--do a vannila boot and see the device to make sure the log device is still intact.
+connect 'jdbc:derby:wombat';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+
+select * from t1;
+autocommit off;
+insert into t1 values(25);
+insert into t1 values(26);
+insert into t1 values(27);
+rollback;
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+
+--performa rollforward recovery with logDevice specified at backup
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlog',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),9);
+select * from t1 ;
+insert into t1 values(25);
+insert into t1 values(26);
+insert into t1 values(27);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+
+--perform a rollforward recovery with log device is moved
+--to some other place than what it was when backup was taken.
+--move the log to different dir name.
+connect 'jdbc:derby:dummycondb;createFrom=extinout/mybackup/wombat;logDevice=extinout/wombatlog1';
+call RENAME_FILE(null,'extinout/wombatlog','extinout/wombatlogmoved');
+disconnect;
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat;logDevice=extinout/wombatlogmoved';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlogmoved',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),14);
+
+select * from t1 ;
+insert into t1 values(30);
+insert into t1 values(31);
+insert into t1 values(32);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--do a plain boot and verify the log device.
+connect 'jdbc:derby:wombat';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlogmoved',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),14);
+select * from t1 ;
+insert into t1 values(33);
+insert into t1 values(34);
+insert into t1 values(35);
+--take a fresh backup again with moved log device.
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--restore and check the results;
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+values SUBSTR(SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice'), LOCATE('wombatlogmoved',SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice')),14);
+select * from t1;
+insert into t1 values(36);
+insert into t1 values(37);
+insert into t1 values(38);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+--simulate OS type copy and then boot(Commented because it does not work in nightlies)
+--connect 'jdbc:derby:dummycondb';
+--call RENAME_FILE('rollForwardBackup', 'wombat', 'wombat.old');
+--call RENAME_FILE(null, 'extinout/mybackup/wombat', 'rollForwardBackup/wombat');
+---disconnect;
+---connect 'jdbc:derby:wombat';
+--Following SHOULD SHOW NULL value.
+--values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice');
+--select * from t1;
+--call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+--     'extinout/mybackup', 1);
+--connect 'jdbc:derby:wombat;shutdown=true';
+--disconnect;
+---createFrom without logDevice specified on URL should have null value.
+connect 'jdbc:derby:tempwombat;createFrom=extinout/mybackup/wombat';
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice');
+select * from t1;
+insert into t1 values(39);
+insert into t1 values(40);
+insert into t1 values(41);
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:tempwombat;shutdown=true';
+disconnect;
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/tempwombat';
+values SYSCS_UTIL.SYSCS_GET_DATABASE_PROPERTY('logDevice');
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+
+---Using plain backup mechanism rstore/recreate db using  restoreFrom/createFrom
+connect 'jdbc:derby:wombat';
+call SYSCS_UTIL.SYSCS_DISABLE_LOG_ARCHIVE_MODE(1);
+select * from t1;
+insert into t1 values(42);
+insert into t1 values(43);
+insert into t1 values(44);
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE('extinout/mybackup');
+--following inserted values should not be there
+--when we do restore from the above backup.
+insert into t1 values(45);
+insert into t1 values(46);
+insert into t1 values(47);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+select * from t1;
+insert into t1 values(45);
+insert into t1 values(46);
+insert into t1 values(47);
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE('extinout/mybackup');
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+connect 'jdbc:derby:wombatnew;createFrom=extinout/mybackup/wombat';
+select * from t1;
+insert into t1 values(48);
+insert into t1 values(49);
+insert into t1 values(50);
+connect 'jdbc:derby:wombatnew;shutdown=true';
+disconnect;
+--enable the log archive mode again.
+connect 'jdbc:derby:wombat';
+call SYSCS_UTIL.SYSCS_BACKUP_DATABASE_AND_ENABLE_LOG_ARCHIVE_MODE(
+    'extinout/mybackup', 1);
+connect 'jdbc:derby:wombat;shutdown=true';
+disconnect;
+
+--NEGATIVE TEST with  RESTORE FLAGS
+-- with createFrom option should give erro on existing database
+connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+-- specify conflictint attributes; it should fail.
+connect 'jdbc:derby:wombat;create=true;createFrom=extinout/mybackup/wombat';
+connect 'jdbc:derby:wombat;create=true;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+connect 'jdbc:derby:wombat;create=true;restoreFrom=extinout/mybackup/wombat';
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat;rollForwardRecoveryFrom=extinout/mybackup/wombat';
+-- With wrong back up path name it shoud fail.
+connect 'jdbc:derby:wombat;rollForwardRecoveryFrom=nobackup/wombat';
+connect 'jdbc:derby:wombat;restoreFrom=nobackup/wombat';
+connect 'jdbc:derby:wombat2;createFrom=nobackup/wombat';
+--Simulate missing files by renaming some files in backup(like a corrupted backup and check 
+--whether we get proper error messages
+--Get a connection because it is required to make any calls in ij 
+connect 'jdbc:derby:wombat2;restoreFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','service.properties','service.properties.old');
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','service.properties.old','service.properties');
+call RENAME_FILE('extinout/mybackup/wombat/','log','log.old');
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','log.old','log');
+call RENAME_FILE('extinout/mybackup/wombat/','seg0','data.old');
+connect 'jdbc:derby:wombat;restoreFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','data.old','seg0');
+--try error cases with createFrom;if root created is not getting cleaned up,
+--next createFrom call will fail with DBLOCATION/wombat exist error.
+call RENAME_FILE('extinout/mybackup/wombat/','service.properties','service.properties.old');
+connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','service.properties.old','service.properties');
+call RENAME_FILE('extinout/mybackup/wombat/','log','log.old');
+connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','log.old','log');
+call RENAME_FILE('extinout/mybackup/wombat/','seg0','data.old');
+connect 'jdbc:derby:wombat;createFrom=extinout/mybackup/wombat';
+call RENAME_FILE('extinout/mybackup/wombat/','data.old','seg0');
+
+drop procedure RENAME_FILE;
+
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,19 @@
+#
+# *** DO NOT PUT PROPERTIES FOR THE DERBY SYSTEM IN THIS FILE.  THEY BELONG
+# *** IN the _derby.properties file.
+#
+# It will get handed to the test on the command line in a -p <filename>
+# argument.
+#
+# This causes ij (or the GUI on ij) to load the driver and make an
+# initial connection to the database.
+#
+#
+ij.protocol=jdbc:derby:
+#database=jdbc:derby:wombat;create=true;logDevice=extinout/wierdlog
+database=jdbc:derby:wombat;create=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true
+useextdirs=true
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,12 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+---------------------------------------------------------------------------------
+# needed for platform tests; path separator masking
+# note, the .* seems to take away too much on occasion, however, without it, nothing gets picked up.
+substitute=XSLAT: Log directory extinout.*crwombatlog.*log;XSLAT: Log directory extinout<ps>crwombatlog<ps>log exists. Please make sure specified log,XSLAT: Log directory extinout/crwombatlog/log exists.;XSLAT: Log directory extinout<ps>crwombat<ps>log exists.,XBM0Y: Backup database directory nobackup.*wombat not found;XBM0Y: Backup database directory nobackup<ps>wombat not found,XBM0Y: Backup database directory nobackup/wombat not found;XBM0Y: Backup database directory nobackup<ps>wombat not found,XBM0Q: File extinout/mybackup/wombat/service.properties not found.;XBM0Q: File extinout<ps>mybackup<ps>wombat<ps>service.properties not found.,XBM0Q: File extinout.*mybackup.*wombat.*service.properties not found.;XBM0Q: File extinout<ps>mybackup<ps>wombat<ps>service.properties not found.,XSDG6: Data segment directory not found in extinout/mybackup/wombat backup during restore.;XSDG6: Data segment directory not found in extinout<ps>mybackup<ps>wombat backup during restore.,XSDG6: Data segment directory not found in extinout.*mybackup.*wombat backup during restore.;XSDG6: Data segment directory not found in extinout<ps>mybackup<ps>wombat backup during restore.,XSLAS: Log directory extinout/mybackup/wombat/log not found;XSLAS: Log directory extinout<ps>mybackup<ps>wombat<ps>log not found,XSLAS: Log directory extinout.*mybackup.*wombat.*log not found;XSLAS: Log directory extinout<ps>mybackup<ps>wombat<ps>log not found

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/short.data
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/short.data?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/short.data	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+test data: a string column inserted as an Ascii stream

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/shortbanner
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/shortbanner?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/shortbanner	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,181 @@
+
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     
+XXXXX                     XXX                
+XX  XX                     XX               
+XX   XX    XXXX   XXX XX   XXXX    XX    XX 
+XX   XX   XX  XX   XXX  X  XX  XX   XX  XX  
+XX   XX   XXXXXX   XX      XX  XX    XXXX   
+XX  XX    XX       XX      XX  XX     XX    
+XXXXX      XXXX   XXXX    X XXX      XX     
+                                    XX      
+                                    XX     

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,1420 @@
+/* 
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.streamingColumn
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.store;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSetMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+import org.apache.derbyTesting.functionTests.util.Formatters;
+import org.apache.derbyTesting.functionTests.util.TestUtil;
+import org.apache.derby.iapi.reference.DB2Limit;
+import java.io.*;
+import java.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.util.zip.CRC32;
+import java.util.Properties;
+
+/**
+ * Test of JDBC result set Stream calls.
+ *
+ * @author djd
+ */
+
+public class streamingColumn { 
+
+			// set up a short (fit in one page) inputstream for insert
+	static String[] fileName;
+	static long[] fileLength;
+
+	static
+	{
+		int numFiles = 4;
+		fileName = new String[numFiles];
+		fileLength = new long[numFiles];
+
+		fileName[0] = "extin/short.data";	// set up a short (fit in one page) inputstream for insert
+		fileName[1] = "extin/shortbanner"; // set up a long (longer than a page) inputstream for insert
+		fileName[2] = "extin/derby.banner"; // set up a really long (over 300K) inputstream for insert
+		fileName[3] = "extin/empty.data"; // set up a file with nothing in it
+	}
+
+
+	public static void main(String[] args) {
+
+		System.out.println("Test streamingColumn starting");
+
+		try {
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			Connection conn = ij.startJBMS();
+
+			streamTest1(conn);
+
+			// test column size 1500 bytes
+			streamTest2(conn, 1500);
+			// test column size 5000 butes
+			streamTest2(conn, 5000);
+			streamTest2(conn, 10000);
+
+			streamTest3(conn, 0);
+			streamTest3(conn, 1500);
+			streamTest3(conn, 5000);
+			streamTest3(conn, 10000);
+
+			streamTest4(conn);
+
+			streamTest5(conn, 0);
+			streamTest5(conn, 1500);
+			streamTest5(conn, 5000);
+			streamTest5(conn, 100000);
+
+			streamTest6(conn, 5000);
+			streamTest7(conn);
+
+            // test 1st column fit, second column doesn't
+            streamTest8(conn, 10, 2500);
+            streamTest9(conn, 10, 2500);
+
+            // test 1st column doesn't fit, second column does
+            streamTest8(conn, 2500, 10);
+            streamTest9(conn, 2500, 10);
+
+			// test compressTable
+			streamTest10(conn);
+
+			// bug 5592 test negativte length for the setXXStream methods. Should fail.
+			streamTest11(conn);
+
+			// bug 5592 test - only non-blank character truncation should give error for varchars
+			streamTest12(conn);
+
+			// bug 5592 test - any character(including blank character) truncation should give error for long varchars
+			streamTest13(conn);
+
+			// turn autocommit on because in JCC, java.sql.Connection.close() can not be
+			// requested while a transaction is in progress on the connection.
+			// If autocommit is off in JCC, the transaction remains active, 
+			// and the connection cannot be closed.
+			// If autocommit is off in Derby, an invalid transaction state SQL exception is thrown.
+			conn.setAutoCommit(true);
+			conn.close();
+
+		} catch (SQLException e) {
+			dumpSQLExceptions(e);
+		} catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+		System.out.println("Test streamingColumn finished");
+    }
+
+	private static void streamTest1(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testLongVarChar (a int, b long varchar)");
+			// insert a null long varchar
+			stmt.execute("insert into testLongVarChar values(1, '')");
+			// insert a long varchar with a short text string
+			stmt.execute("insert into testLongVarChar values(2, 'test data: a string column inserted as an object')");
+
+
+			for (int i = 0; i < fileName.length ; i++) {
+				// prepare an InputStream from the file
+				File file = new File(fileName[i]);
+				fileLength[i] = file.length();
+				InputStream fileIn = new FileInputStream(file);
+
+				System.out.println("===> testing " + fileName[i] + " length = "
+								   + fileLength[i]);
+
+				// insert a streaming column
+				PreparedStatement ps = conn.prepareStatement("insert into testLongVarChar values(?, ?)");
+				ps.setInt(1, 100 + i);
+				ps.setAsciiStream(2, fileIn, (int)fileLength[i]);
+				try {//if trying to insert data > 32700, there will be an exception
+					ps.executeUpdate();
+					System.out.println("No truncation and hence no error");
+				}
+				catch (SQLException e) {
+					if (fileLength[i] > DB2Limit.DB2_LONGVARCHAR_MAXWIDTH && e.getSQLState().equals("22001")) //was getting data longer than maxValueAllowed
+						System.out.println("expected exception for data > " + DB2Limit.DB2_LONGVARCHAR_MAXWIDTH + " in length");
+					else
+						dumpSQLExceptions(e);
+				}
+				fileIn.close();
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarChar");
+			met = rs.getMetaData();
+			byte[] buff = new byte[128];
+			// fetch all rows back, get the long varchar columns as streams.
+			while (rs.next()) {
+				// get the first column as an int
+				int a = rs.getInt("a");
+				// get the second column as a stream
+				InputStream fin = rs.getAsciiStream(2);
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+				verifyLength(a, columnSize, fileLength);
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarChar order by a");
+			met = rs.getMetaData();
+			// fetch all rows back in order, get the long varchar columns as streams.
+			while (rs.next()) {
+				// get the first column as an int
+				int a = rs.getInt("a");
+				// get the second column as a stream
+				InputStream fin = rs.getAsciiStream(2);
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+				verifyLength(a, columnSize, fileLength);
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarChar");
+			// fetch all rows back, get the long varchar columns as Strings.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				String resultString = rs.getString(2);
+				verifyLength(a, resultString.length(), fileLength);
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarChar order by a");
+			// fetch all rows back in order, get the long varchar columns as Strings.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				String resultString = rs.getString(2);
+				verifyLength(a, resultString.length(), fileLength);
+			}
+
+			rs = stmt.executeQuery(
+				"select a, b from testLongVarChar where b like 'test data: a string column inserted as an object'");
+			// should return one row.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				String resultString = rs.getString(2);
+				verifyLength(a, resultString.length(), fileLength);
+			}
+
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024')");
+			stmt.executeUpdate("create table foo (a int not null, b long varchar, primary key (a))");
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL)");
+			insertLongString(conn, 10, "ssssssssss", false);
+
+
+			insertLongString(conn, 0, "", false);
+			insertLongString(conn, 1, "1", false);
+			insertLongString(conn, -1, null, false);
+			insertLongString(conn, 20, "XXXXXXXXXXXXXXXXXXXX", false);
+
+			rs = stmt.executeQuery("select a, b from foo");
+
+			System.out.println("expect to get null string back");
+			while(rs.next())
+			{
+				int a = rs.getInt("a");
+				String resultString = rs.getString(2);
+				if (resultString == null)
+				{
+					System.out.println("a = " + a + " got null string back");
+				}
+				else if (resultString.length() != a)
+				{
+					System.out.println("FAIL - failed to get string back, expect "+
+									   a + " got " + resultString.length());
+				}
+			}
+
+			updateLongString(conn, 1, 3000);
+			updateLongString(conn, 0, 800);
+			updateLongString(conn, 3000, 0);
+			updateLongString(conn, 0, 51);
+			updateLongString(conn, 20, 0);
+			rs = stmt.executeQuery("select a, b from foo");
+			while(rs.next())
+			{
+				int a = rs.getInt("a");
+				String resultString = rs.getString(2);
+				if (resultString == null)
+				{
+					System.out.println("a = " + a + " got null string back");
+				}
+				else if (resultString.length() != a)
+				{
+					System.out.println("FAIL - failed to get string back, expect "+
+									   a + " got " + resultString.length() +
+									   " " + resultString);
+				}
+			}
+
+			stmt.executeUpdate("drop table foo");
+
+			rs.close();
+			stmt.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+	}
+
+	static void streamTest2(Connection conn, long length) throws Exception
+	{
+		Statement sourceStmt = conn.createStatement();
+
+		sourceStmt.executeUpdate("create table foo (a int not null, b long varchar, primary key (a))");
+
+		insertLongString(conn, 1, pad("Broadway", length), false);
+		insertLongString(conn, 2, pad("Franklin", length), false);
+		insertLongString(conn, 3, pad("Webster", length), false);
+
+		sourceStmt.executeUpdate("insert into foo select a+100, b from foo");
+
+		verifyExistence(conn, 1, "Broadway", length);
+		verifyExistence(conn, 2, "Franklin", length);
+		verifyExistence(conn, 3, "Webster", length);
+		verifyExistence(conn, 101, "Broadway", length);
+		verifyExistence(conn, 102, "Franklin", length);
+		verifyExistence(conn, 103, "Webster", length);
+
+		sourceStmt.executeUpdate("drop table foo");
+	}
+
+	static void streamTest3(Connection conn, long length) throws Exception
+	{
+		Statement sourceStmt = conn.createStatement();
+		sourceStmt.executeUpdate("create table foo (a int not null constraint pk primary key, b long varchar)");
+
+		insertLongString(conn, 1, pad("Broadway", length), false);
+		insertLongString(conn, 2, pad("Franklin", length), false);
+		insertLongString(conn, 3, pad("Webster", length), false);
+		PreparedStatement ps = conn.prepareStatement(
+			"update foo set a=a+1000, b=? where a<99 and a in (select a from foo)");
+
+		File file = new File("extin/short.data");
+		InputStream fileIn = new FileInputStream(file);
+		ps.setAsciiStream(1, fileIn, (int)(file.length()));
+		ps.executeUpdate();
+		fileIn.close();
+
+		ps = conn.prepareStatement(
+			"update foo set a=a+1000, b=? where a<99 and a in (select a from foo)");
+		file = new File("extin/shortbanner");
+		fileIn = new FileInputStream(file);
+		ps.setAsciiStream(1, fileIn, (int)(file.length()));
+		ps.executeUpdate();
+		fileIn.close();
+
+		sourceStmt.executeUpdate("drop table foo");
+	}
+
+	private static void streamTest4(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testLongVarBinary (a int, b BLOB(1G))");
+			// insert an empty string 
+			stmt.execute("insert into testLongVarBinary values(1, CAST (" +
+						 TestUtil.stringToHexLiteral("") + "AS BLOB(1G)))");
+			// insert a short text string
+			stmt.execute("insert into testLongVarBinary values(2,CAST (" +
+						 TestUtil.stringToHexLiteral("test data: a string column inserted as an object") + "AS BLOB(1G)))");
+
+			for (int i = 0; i < fileName.length; i++) {
+				// prepare an InputStream from the file
+				File file = new File(fileName[i]);
+				fileLength[i] = file.length();
+				InputStream fileIn = new FileInputStream(file);
+
+				System.out.println("===> testing " + fileName[i] + " length = "
+								   + fileLength[i]);
+
+				// insert a streaming column
+				PreparedStatement ps = conn.prepareStatement("insert into testLongVarBinary values(?, ?)");
+				ps.setInt(1, 100 + i);
+				ps.setBinaryStream(2, fileIn, (int)fileLength[i]);
+				ps.executeUpdate();
+				fileIn.close();
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarBinary");
+			met = rs.getMetaData();
+			byte[] buff = new byte[128];
+			// fetch all rows back, get the long varchar columns as streams.
+			while (rs.next()) {
+				// get the first column as an int
+				int a = rs.getInt("a");
+				// get the second column as a stream
+				InputStream fin = rs.getBinaryStream(2);
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff, 0, 100);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarBinary order by a");
+			met = rs.getMetaData();
+			// fetch all rows back in order, get the long varchar columns as streams.
+			while (rs.next()) {
+				// get the first column as an int
+				int a = rs.getInt("a");
+				// get the second column as a stream
+				InputStream fin = rs.getBinaryStream(2);
+				int columnSize = 0;
+				for (;;) {
+					int size = fin.read(buff);
+					if (size == -1)
+						break;
+					columnSize += size;
+				}
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarBinary");
+			// fetch all rows back, get the long varchar columns as Strings.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				String resultString = rs.getString(2);
+			}
+
+			rs = stmt.executeQuery("select a, b from testLongVarBinary order by a");
+			// fetch all rows back in order, get the long varchar columns as Strings.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				String resultString = rs.getString(2);
+			}
+
+			rs.close();
+			stmt.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+	}
+
+	static void streamTest5(Connection conn, long length) throws Exception
+	{
+		Statement sourceStmt = conn.createStatement();
+		String binaryType = length > 32700 ? "BLOB(1G)" : "long varchar for bit data";
+		sourceStmt.executeUpdate("create table foo (a int not null constraint pk primary key, b " + binaryType + " )");
+
+		insertLongString(conn, 1, pad("Broadway", length), true);
+		insertLongString(conn, 2, pad("Franklin", length), true);
+		insertLongString(conn, 3, pad("Webster", length), true);
+		insertLongString(conn, 4, pad("Broadway", length), true);
+		insertLongString(conn, 5, pad("Franklin", length), true);
+		insertLongString(conn, 6, pad("Webster", length), true);
+		PreparedStatement ps = conn.prepareStatement(
+			"update foo set a=a+1000, b=? where a<99 and a in (select a from foo)");
+		File file = new File("extin/short.data");
+		InputStream fileIn = new FileInputStream(file);
+		ps.setBinaryStream(1, fileIn, (int)(file.length()));
+		ps.executeUpdate();
+		fileIn.close();
+
+		ps = conn.prepareStatement(
+			"update foo set a=a+1000, b=? where a<99 and a in (select a from foo)");
+		file = new File("extin/shortbanner");
+		fileIn = new FileInputStream(file);
+		ps.setBinaryStream(1, fileIn, (int)(file.length()));
+		ps.executeUpdate();
+		ps.close();
+		fileIn.close();
+
+		sourceStmt.executeUpdate("drop table foo");
+	}
+
+	static void streamTest6(Connection conn, long length) throws Exception
+	{
+		Statement sourceStmt = conn.createStatement();
+		sourceStmt.executeUpdate("create table foo (a int not null constraint pk primary key, b long varchar)");
+
+		insertLongString(conn, 1, pad("Broadway", length), false);
+		insertLongString(conn, 2, pad("Franklin", length), false);
+		insertLongString(conn, 3, pad("Webster", length), false);
+		PreparedStatement ps = conn.prepareStatement(
+			"update foo set a=a+1000, b=? where a<99 and a in (select a from foo)");
+
+		streamInLongCol(ps, pad("Grand", length));
+		ps.close();
+		sourceStmt.close();
+	}
+
+	static void streamTest7(Connection conn) throws Exception
+	{
+		conn.setAutoCommit(false);
+
+		System.out.println("streamTest7");
+
+ 		Statement s = conn.createStatement();
+		s.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024')");
+		s.execute("create table testlvc (a int, b char(100), lvc long varchar, d char(100))");
+		s.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL)");
+		s.close();
+		conn.commit();
+
+		PreparedStatement ps1 = conn.prepareStatement(
+			"insert into testlvc values (?, 'filler for column b on null column', null, 'filler for column d')");
+
+		PreparedStatement ps2 = conn.prepareStatement(
+			"insert into testlvc values (?, 'filler for column b on empty string column', ?, 'filler2 for column d')");
+
+
+		for (int i= 0; i < 100; i++)
+		{
+			ps1.setInt(1, i);
+			ps1.executeUpdate();
+
+			ByteArrayInputStream emptyString = new ByteArrayInputStream(new byte[0]);
+			ps2.setInt(1, i);
+			ps2.setAsciiStream(2, emptyString, 0);
+			ps2.executeUpdate();
+		}
+		ps1.close();
+		ps2.close();
+
+		conn.commit();
+
+		PreparedStatement ps = conn.prepareStatement("update testlvc set lvc = ? where a = ?");
+
+		String longString =
+			"this is a relatively long string, hopefully the row will be split or otherwise become long ???  I don't think it will become long but maybe if it rolls back it will become strange";
+		for (int i = 0; i < 100; i++)
+		{
+			ByteArrayInputStream string1 = new ByteArrayInputStream(longString.getBytes());
+			ps.setAsciiStream(1, string1, longString.length());
+			ps.setInt(2, i);
+			ps.executeUpdate();
+			if ((i % 2) == 0)
+				conn.rollback();
+			else
+				conn.commit();
+
+			ByteArrayInputStream emptyString = new ByteArrayInputStream(new byte[0]);
+			ps.setAsciiStream(1, emptyString, 0);
+			ps.executeUpdate();
+			if ((i%3) == 0)
+				conn.rollback();
+			else
+				conn.commit();
+		}
+
+		ps.close();
+	}
+
+    /**
+     * long row test of insert/backout case, using setAsciiStream().
+     * <p>
+     * The heap tries to make rows all fit on one page if possible.  So it
+     * first asks raw store to try inserting without overflowing rows or
+     * columns.  If that doesn't work it then asks raw store for a mostly
+     * empty page and tries to insert it there with overflow, If that doesn't
+     * work then an empty page is picked.
+     * <p>
+     * If input parameters are conn,10,2500 - then the second row inserted
+     * will have the 1st column fit, but the second not fit which caused
+     * track #2240.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+	static void streamTest8(Connection conn, int stream1_len, int stream2_len)
+	{
+        System.out.println(
+            "Starting streamTest8(conn, " +
+            stream1_len + ", " + stream2_len + ")");
+
+		ResultSetMetaData   met;
+		ResultSet           rs;
+		Statement           stmt;
+
+		String createsql =
+            new String(
+                "create table t8(a int, b long varchar, c long varchar)");
+
+		String insertsql = new String("insert into t8 values (?, ?, ?) ");
+
+
+		int numStrings = 10;
+
+		byte[][] stream1_byte_array = new byte[numStrings][];
+		byte[][] stream2_byte_array = new byte[numStrings][];
+
+		// make string size match input sizes.
+		for (int i = 0; i < numStrings; i++)
+		{
+			stream1_byte_array[i] = new byte[stream1_len];
+
+			for (int j = 0; j < stream1_len; j++)
+				stream1_byte_array[i][j] = (byte)('a'+i);
+
+			stream2_byte_array[i] = new byte[stream2_len];
+			for (int j = 0; j < stream2_len; j++)
+				stream2_byte_array[i][j] = (byte)('A'+i);
+		}
+
+		try
+		{
+			conn.setAutoCommit(false);
+			stmt = conn.createStatement();
+			stmt.execute(createsql);
+			conn.commit();
+
+			PreparedStatement insert_ps = conn.prepareStatement(insertsql);
+
+
+
+			for (int i = 0; i < numStrings; i++)
+			{
+                // create the stream and insert it
+                insert_ps.setInt(1, i);
+
+                // create the stream and insert it
+                insert_ps.setAsciiStream(
+                    2, new ByteArrayInputStream(stream1_byte_array[i]), stream1_len);
+
+                // create the stream and insert it
+                insert_ps.setAsciiStream(
+                    3, new ByteArrayInputStream(stream2_byte_array[i]), stream2_len);
+
+				insert_ps.executeUpdate();
+
+                // just force a scan of the table, no insert is done.
+				String checkSQL =
+                    "insert into t8 select * from t8 where a = -6363";
+				stmt.execute(checkSQL);
+			}
+
+			insert_ps.close();
+			conn.commit();
+
+
+			rs = stmt.executeQuery("select a, b, c from t8" );
+
+			// should return one row.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				String resultString = rs.getString(2);
+
+                // compare result with expected
+                String canon = new String(stream1_byte_array[a]);
+
+                if (canon.compareTo(resultString) != 0)
+                {
+                    System.out.println(
+                        "FAIL -- bad result string:" +
+                        "canon: " + canon +
+                        "resultString: " + resultString);
+                }
+
+				// get the second column as a string
+				resultString = rs.getString(3);
+
+                // compare result with expected
+                canon = new String(stream2_byte_array[a]);
+
+                if (canon.compareTo(resultString) != 0)
+                {
+                    System.out.println(
+                        "FAIL -- bad result string:" +
+                        "canon: " + canon +
+                        "resultString: " + resultString);
+                }
+			}
+
+			rs.close();
+
+
+			stmt.execute("insert into t8 select * from t8");
+
+			stmt.executeUpdate("drop table t8");
+
+			stmt.close();
+			conn.commit();
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+        System.out.println(
+            "Finishing streamTest8(conn, " +
+            stream1_len + ", " + stream2_len + ")");
+	}
+
+    /**
+     * long row test of insert/backout case, using setBinaryStream().
+     * <p>
+     * The heap tries to make rows all fit on one page if possible.  So it
+     * first asks raw store to try inserting without overflowing rows or
+     * columns.  If that doesn't work it then asks raw store for a mostly
+     * empty page and tries to insert it there with overflow, If that doesn't
+     * work then an empty page is picked.
+     * <p>
+     * If input parameters are conn,10,2500 - then the second row inserted
+     * will have the 1st column fit, but the second not fit which caused
+     * track #2240.
+     *
+	 * @exception  StandardException  Standard exception policy.
+     **/
+	static void streamTest9(Connection conn, int stream1_len, int stream2_len)
+	{
+        System.out.println(
+            "Starting streamTest9(conn, " +
+            stream1_len + ", " + stream2_len + ")");
+
+		ResultSetMetaData   met;
+		ResultSet           rs;
+		Statement           stmt;
+
+		String createsql =
+            new String(
+                "create table t9(a int, b long varchar for bit data, c long varchar for bit data)");
+
+		String insertsql = new String("insert into t9 values (?, ?, ?) ");
+
+
+		int numStrings = 10;
+
+		byte[][] stream1_byte_array = new byte[numStrings][];
+		byte[][] stream2_byte_array = new byte[numStrings][];
+
+		// make string size match input sizes.
+		for (int i = 0; i < numStrings; i++)
+		{
+			stream1_byte_array[i] = new byte[stream1_len];
+
+			for (int j = 0; j < stream1_len; j++)
+				stream1_byte_array[i][j] = (byte)('a'+i);
+
+			stream2_byte_array[i] = new byte[stream2_len];
+			for (int j = 0; j < stream2_len; j++)
+				stream2_byte_array[i][j] = (byte)('A'+i);
+		}
+
+		try
+		{
+			conn.setAutoCommit(false);
+			stmt = conn.createStatement();
+			stmt.execute(createsql);
+			conn.commit();
+
+			PreparedStatement insert_ps = conn.prepareStatement(insertsql);
+
+
+
+			for (int i = 0; i < numStrings; i++)
+			{
+                // create the stream and insert it
+                insert_ps.setInt(1, i);
+
+                // create the stream and insert it
+                insert_ps.setBinaryStream(
+                    2, new ByteArrayInputStream(stream1_byte_array[i]), stream1_len);
+
+                // create the stream and insert it
+                insert_ps.setBinaryStream(
+                    3, new ByteArrayInputStream(stream2_byte_array[i]), stream2_len);
+
+				insert_ps.executeUpdate();
+
+                // just force a scan of the table, no insert is done.
+				String checkSQL =
+                    "insert into t9 select * from t9 where a = -6363";
+				stmt.execute(checkSQL);
+			}
+
+			insert_ps.close();
+			conn.commit();
+
+
+			rs = stmt.executeQuery("select a, b, c from t9" );
+
+			// should return one row.
+			while (rs.next())
+			{
+				// JDBC columns use 1-based counting
+
+				// get the first column as an int
+				int a = rs.getInt("a");
+
+				// get the second column as a string
+				byte[] resultString = rs.getBytes(2);
+
+                // compare result with expected
+                byte[] canon = stream1_byte_array[a];
+
+                if (!byteArrayEquals(
+                        canon,        0, canon.length,
+                        resultString, 0, resultString.length))
+                {
+                    // System.out.println(
+                    //   "FAIL -- bad result byte array 1:" +
+                    //   "canon: " + ByteArray.hexDump(canon) +
+                    //   "resultString: " + ByteArray.hexDump(resultString));
+                    System.out.println(
+                        "FAIL -- bad result byte array 1:" +
+                        "canon: " + canon +
+                        "resultString: " + resultString);
+                }
+
+				// get the second column as a string
+				resultString = rs.getBytes(3);
+
+                // compare result with expected
+                canon = stream2_byte_array[a];
+
+                if (!byteArrayEquals(
+                        canon,        0, canon.length,
+                        resultString, 0, resultString.length))
+                {
+                    // System.out.println(
+                    //   "FAIL -- bad result byte array 2:" +
+                    //   "canon: " + ByteArray.hexDump(canon) +
+                    //   "resultString: " + ByteArray.hexDump(resultString));
+                    System.out.println(
+                        "FAIL -- bad result byte array 2:" +
+                        "canon: " + canon +
+                        "resultString: " + resultString);
+                }
+			}
+
+			rs.close();
+
+			stmt.execute("insert into t9 select * from t9");
+
+			stmt.executeUpdate("drop table t9");
+
+			stmt.close();
+			conn.commit();
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+
+        System.out.println(
+            "Finishing streamTest9(conn, " +
+            stream1_len + ", " + stream2_len + ")");
+	}
+
+    /**
+     * table with multiple indexes, indexes share columns
+     * table has more than 4 rows, insert stream into table
+     * compress table and verify that each index is valid
+	 * @exception  StandardException  Standard exception policy.
+     **/
+	private static void streamTest10(Connection conn) {
+
+		ResultSetMetaData met;
+		ResultSet rs;
+		Statement stmt;
+		System.out.println("Testing 10 starts from here");
+
+		try {
+			stmt = conn.createStatement();
+            //create the table
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024')");
+			stmt.execute("create table tab10 (a int, b int, c long   varchar)");
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL)");
+            //create the indexes which shares columns
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096')");
+            stmt.execute("create index i_a on tab10 (a)");
+			stmt.execute("create index i_ab on tab10 (a, b)");
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL)");
+
+			// insert a null long varchar
+			stmt.execute("insert into tab10 values(1, 1, '')");
+			// insert a long varchar with a short text string
+			stmt.execute("insert into tab10 values(2, 2, 'test data: a string column inserted as an object')");
+
+			//insert stream into table
+			for (int i = 0; i < fileName.length; i++) {
+				// prepare an InputStream from the file
+				File file = new File(fileName[i]);
+				fileLength[i] = file.length();
+				InputStream fileIn = new FileInputStream(file);
+
+				System.out.println("===> testing " + fileName[i] + " length = "
+								   + fileLength[i]);
+
+				// insert a streaming column
+				PreparedStatement ps = conn.prepareStatement("insert into tab10 values(?, ?, ?)");
+				ps.setInt(1, 100 + i);
+				ps.setInt(2, 100 + i);
+				ps.setAsciiStream(3, fileIn, (int)fileLength[i]);
+				try {//if trying to insert data > 32700, there will be an exception
+					ps.executeUpdate();
+					System.out.println("No truncation and hence no error");
+				}
+				catch (SQLException e) {
+					if (fileLength[i] > DB2Limit.DB2_LONGVARCHAR_MAXWIDTH && e.getSQLState().equals("22001")) //was getting data longer than maxValueAllowed
+						System.out.println("expected exception for data > " + DB2Limit.DB2_LONGVARCHAR_MAXWIDTH + " in length");
+					else
+						dumpSQLExceptions(e);
+				}
+				fileIn.close();
+			}
+
+			//execute the compress command
+            CallableStatement cs = conn.prepareCall(
+                "CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");
+            cs.setString(1, "APP");
+            cs.setString(2, "testLongVarChar");
+            cs.setInt(3, 0);
+            cs.execute();
+
+			//do consistency checking
+			stmt.execute("CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker' LANGUAGE JAVA PARAMETER STYLE JAVA");
+			stmt.execute("VALUES ConsistencyChecker()");
+
+			stmt.close();
+
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+        System.out.println("Testing 10 ends in here");
+	}
+
+	private static void streamTest11(Connection conn) {
+
+		Statement stmt;
+
+		System.out.println("Test 11 - Can't pass negative length as the stream length for various setXXXStream methods");
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testLongVarCharInvalidStreamLength (a int, b long varchar, c long varchar for bit data)");
+			// prepare an InputStream from the file
+			File file = new File("extin/short.data");
+			InputStream fileIn = new FileInputStream(file);
+
+			PreparedStatement ps = conn.prepareStatement("insert into testLongVarCharInvalidStreamLength values(?, ?, ?)");
+			ps.setInt(1, 100);
+			try {
+				System.out.println("===> testing using setAsciiStream with -2 as length");
+				ps.setAsciiStream(2, fileIn, -2); //test specifically for bug 4250
+				System.out.println("FAIL -- should have gotten exception for -2 param value to setAsciiStream");
+			}
+			catch (SQLException e) {
+				if ("XJ025".equals(e.getSQLState()))
+					System.out.println("PASS -- expected exception:" + e.toString());
+				else
+					dumpSQLExceptions(e);
+			}
+
+			Reader filer = new InputStreamReader(fileIn);
+			try {
+				System.out.println("===> testing using setCharacterStream with -1 as length");
+				ps.setCharacterStream(2, filer, -1);
+				System.out.println("FAIL -- should have gotten exception for -1 param value to setCharacterStream");
+			}
+			catch (SQLException e) {
+				if ("XJ025".equals(e.getSQLState()))
+					System.out.println("PASS -- expected exception:" + e.toString());
+				else
+					dumpSQLExceptions(e);
+			}
+
+			try {
+				System.out.println("===> testing using setBinaryStream with -1 as length");
+				ps.setBinaryStream(3, fileIn, -1);
+				System.out.println("FAIL -- should have gotten exception for -1 param value to setBinaryStream");
+			}
+			catch (SQLException e) {
+				if ("XJ025".equals(e.getSQLState()))
+					System.out.println("PASS -- expected exception:" + e.toString());
+				else
+					dumpSQLExceptions(e);
+			}
+
+			fileIn.close();
+		}
+		catch (SQLException e) {
+				dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+	 	System.out.println("Test 11 - negative stream length tests end in here");
+	}
+
+	private static void streamTest12(Connection conn) {
+
+		ResultSet rs;
+		Statement stmt;
+
+		//The following 2 files are for testing the truncation in varchar.
+		//only non-blank character truncation will throw an exception for varchars.
+		//max value allowed in varchars is 32672 characters long
+		String fileName1 = "extin/char32675trailingblanks.data"; // set up a file 32675 characters long but with last 3 characters as blanks
+		String fileName2 = "extin/char32675.data"; // set up a file 32675 characters long with 3 extra non-blank characters trailing in the end
+
+		System.out.println("Test 12 - varchar truncation tests start from here");
+		try {
+			stmt = conn.createStatement();
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096')");
+			stmt.execute("create table testVarChar (a int, b varchar(32672))");
+			//create a table with 4 varchars. This table will be used to try overflow through concatenation
+			stmt.execute("create table testConcatenation (a varchar(16350), b varchar(16350), c varchar(16336), d varchar(16336))");
+			stmt.executeUpdate("call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL)");
+			String largeStringA16350 = new String(Formatters.repeatChar("a",16350));
+			String largeStringA16336 = new String(Formatters.repeatChar("a",16336));
+			PreparedStatement ps = conn.prepareStatement("insert into testConcatenation values (?, ?, ?, ?)");
+			ps.setString(1, largeStringA16350);
+			ps.setString(2, largeStringA16350);
+			ps.setString(3, largeStringA16336);
+			ps.setString(4, largeStringA16336);
+			ps.executeUpdate();
+
+			ps = conn.prepareStatement("insert into testVarChar values(?, ?)");
+
+			// prepare an InputStream from the file which has 3 trailing blanks in the end, so after blank truncation, there won't be any overflow
+			// try this using setAsciiStream, setCharacterStream, setString and setObject
+			insertDataUsingAsciiStream(ps, 1, fileName1, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+			insertDataUsingCharacterStream(ps, 2, fileName1, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+			insertDataUsingStringOrObject(ps, 3, DB2Limit.DB2_VARCHAR_MAXWIDTH, true, true);
+			insertDataUsingStringOrObject(ps, 4, DB2Limit.DB2_VARCHAR_MAXWIDTH, true, false);
+			System.out.println("===> testing trailing blanks using concatenation");
+			insertDataUsingConcat(stmt, 5, DB2Limit.DB2_VARCHAR_MAXWIDTH, true, false);
+
+			// prepare an InputStream from the file which has 3 trailing non-blanks in the end, and hence there would be overflow exception
+			// try this using setAsciiStream, setCharacterStream, setString and setObject
+			insertDataUsingAsciiStream(ps, 6, fileName2, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+			insertDataUsingCharacterStream(ps, 7, fileName2, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+			insertDataUsingStringOrObject(ps, 8, DB2Limit.DB2_VARCHAR_MAXWIDTH, false, true);
+			insertDataUsingStringOrObject(ps, 9, DB2Limit.DB2_VARCHAR_MAXWIDTH, false, false);
+			System.out.println("===> testing trailing non-blank characters using concatenation");
+			insertDataUsingConcat(stmt, 10, DB2Limit.DB2_VARCHAR_MAXWIDTH, false, false);
+
+			rs = stmt.executeQuery("select a, b from testVarChar");
+			streamTestDataVerification(rs, DB2Limit.DB2_VARCHAR_MAXWIDTH);
+    }
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+	 	System.out.println("Test 12 - varchar truncation tests end in here");
+	}
+
+	private static void streamTest13(Connection conn) {
+
+		ResultSet rs;
+		Statement stmt;
+
+		//The following 2 files are for testing the truncation in long varchar.
+		//any character truncation (including blanks characters) will throw an exception for long varchars.
+		//max value allowed in long varchars is 32700 characters long
+		String fileName1 = "extin/char32703trailingblanks.data"; // set up a file 32703 characters long but with last 3 characters as blanks
+		String fileName2 = "extin/char32703.data"; // set up a file 32703 characters long with 3 extra non-blank characters trailing in the end
+
+		System.out.println("Test 13 - long varchar truncation tests start from here");
+		try {
+			stmt = conn.createStatement();
+			stmt.execute("create table testLongVarChars (a int, b long varchar)");
+			PreparedStatement ps = conn.prepareStatement("insert into testLongVarChars values(?, ?)");
+
+			// prepare an InputStream from the file which has 3 trailing blanks in the end. For long varchar, this would throw a truncation error
+			// try this using setAsciiStream, setCharacterStream, setString and setObject
+			insertDataUsingAsciiStream(ps, 1, fileName1, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH);
+			insertDataUsingCharacterStream(ps, 2, fileName1, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH);
+			insertDataUsingStringOrObject(ps, 3, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH, true, true);
+			insertDataUsingStringOrObject(ps, 4, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH, true, false);
+			//bug 5600- Can't test data overflow in longvarchar using concatenation because longvarchar concatenated string can't be longer than 32700
+			//System.out.println("===> testing trailing blanks using concatenation");
+			//insertDataUsingConcat(stmt, 5, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH, true, true);
+
+			// prepare an InputStream from the file which has 3 trailing non-blanks in the end, and hence there would be overflow exception
+			// try this using setAsciiStream, setCharacterStream, setString and setObject
+			insertDataUsingAsciiStream(ps, 6, fileName2, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH);
+			insertDataUsingCharacterStream(ps, 7, fileName2, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH);
+			insertDataUsingStringOrObject(ps, 7, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH, false, true);
+			insertDataUsingStringOrObject(ps, 9, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH, false, false);
+			//bug 5600 - Can't test data overflow in longvarchar using concatenation because longvarchar concatenated string can't be longer than 32700
+			//System.out.println("===> testing trailing non-blank characters using concatenation");
+			//insertDataUsingConcat(stmt, 10, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH, false, true);
+
+			rs = stmt.executeQuery("select a, b from testLongVarChars");
+			streamTestDataVerification(rs, DB2Limit.DB2_LONGVARCHAR_MAXWIDTH);
+		}
+		catch (SQLException e) {
+			dumpSQLExceptions(e);
+		}
+		catch (Throwable e) {
+			System.out.println("FAIL -- unexpected exception:" + e.toString());
+		}
+	 	System.out.println("Test 13 - long varchar truncation tests end in here");
+	}
+
+
+	private static void streamTestDataVerification(ResultSet rs, int maxValueAllowed)
+	throws Exception{
+		ResultSetMetaData met;
+
+		met = rs.getMetaData();
+		byte[] buff = new byte[128];
+		// fetch all rows back, get the varchar and/ long varchar columns as streams.
+		while (rs.next()) {
+			// get the first column as an int
+			int a = rs.getInt("a");
+			// get the second column as a stream
+			InputStream fin = rs.getAsciiStream(2);
+			int columnSize = 0;
+			for (;;) {
+				int size = fin.read(buff);
+					if (size == -1)
+					break;
+					columnSize += size;
+			}
+			if((a>=1 && a <= 5) && columnSize == maxValueAllowed)
+				System.out.println("===> verified length " + maxValueAllowed);
+			else
+				System.out.println("test failed, columnSize should be " + maxValueAllowed + " but it is" + columnSize);
+		}
+	}
+
+	//blankPadding
+	//  true means excess trailing blanks
+	//  false means excess trailing non-blank characters
+	//forLongVarChar
+	//  true means testing for long varchar truncation and hence use table testLongVarChars
+	//  false means testing for varchar truncation and hence use table testVarChar
+	private static void insertDataUsingConcat(Statement stmt, int intValue, int maxValueAllowed, boolean blankPadding,
+	 	boolean forLongVarChar)
+	throws Exception{
+		String sql;
+		if (forLongVarChar)
+			sql = "insert into testLongVarChars select " + intValue + ", a||b||";
+		else
+			sql = "insert into testVarChar select "+ intValue + ", c||d||";
+
+		if (blankPadding) //try overflow with trailing blanks
+			sql = sql.concat("'   ' from testConcatenation");
+		else //try overflow with trailing non-blank characters
+			sql = sql.concat("'123' from testConcatenation");
+
+		//for varchars, trailing blank truncation will not throw an exception. Only non-blank characters will cause truncation error
+		//for long varchars, any character truncation will throw an exception.
+		try {
+			stmt.execute(sql);
+			System.out.println("No truncation and hence no error.");
+		}
+		catch (SQLException e) {
+			if (e.getSQLState().equals("22001")) //truncation error
+				System.out.println("expected exception for data > " + maxValueAllowed + " in length");
+			else
+				dumpSQLExceptions(e);
+		}
+	}
+
+	//blankPadding
+	//  true means excess trailing blanks
+	//  false means excess trailing non-blank characters
+	//testUsingString
+	//  true means try setString method for overflow
+	//  false means try setObject method for overflow
+	private static void insertDataUsingStringOrObject(PreparedStatement ps, int intValue, int maxValueAllowed,
+	 	boolean blankPadding, boolean testUsingString)
+	throws Exception{
+	 	StringBuffer sb = new StringBuffer(maxValueAllowed);
+	 	for (int i = 0; i < maxValueAllowed; i++)
+			sb.append('q');
+
+	 	String largeString = new String(sb);
+	 	if (blankPadding) {
+			largeString = largeString.concat("   ");
+			System.out.print("===> testing trailing blanks(using ");
+	 	} else {
+			largeString = largeString.concat("123");
+			System.out.print("===> testing trailing non-blanks(using ");
+	 	}
+
+	 	ps.setInt(1, intValue);
+	 	if (testUsingString) {
+			System.out.println("setString) length = " + largeString.length());
+			ps.setString(2, largeString);
+	 	} else {
+			System.out.println("setObject) length = " + largeString.length());
+			ps.setObject(2, largeString);
+	 	}
+
+		//for varchars, trailing blank truncation will not throw an exception. Only non-blank characters cause truncation error
+		//for long varchars, any character truncation will throw an exception.
+	 	try {
+			ps.executeUpdate();
+			System.out.println("No truncation and hence no error");
+	 	}
+	 	catch (SQLException e) {
+			if (largeString.length() > maxValueAllowed && e.getSQLState().equals("22001")) //truncation error
+				System.out.println("expected exception for data > " + maxValueAllowed + " in length");
+			else
+				dumpSQLExceptions(e);
+	 	}
+	}
+
+	private static void insertDataUsingCharacterStream(PreparedStatement ps, int intValue, String fileName, int maxValueAllowed)
+	throws Exception{
+	 	File file = new File(fileName);
+	 	InputStream fileIn = new FileInputStream(file);
+	 	Reader filer = new InputStreamReader(fileIn);
+	 	System.out.println("===> testing(using setCharacterStream) " + fileName + " length = " + file.length());
+	 	ps.setInt(1, intValue);
+	 	// insert a streaming column
+	 	ps.setCharacterStream(2, filer, (int)file.length());
+		//for varchars, trailing blank truncation will not throw an exception. Only non-blank characters cause truncation error
+		//for long varchars, any character truncation will throw an exception.
+	 	try {
+			ps.executeUpdate();
+			System.out.println("No truncation and hence no error");
+	 	}
+	 	catch (SQLException e) {
+			if (file.length() > maxValueAllowed && e.getSQLState().equals("22001")) //truncation error
+				System.out.println("expected exception for data > " + maxValueAllowed + " in length");
+			else
+				dumpSQLExceptions(e);
+	 	}
+	 	filer.close();
+	}
+
+	private static void insertDataUsingAsciiStream(PreparedStatement ps, int intValue, String fileName, int maxValueAllowed)
+	throws Exception{
+	 	File file = new File(fileName);
+	 	InputStream fileIn = new FileInputStream(file);
+	 	System.out.println("===> testing(using setAsciiStream) " + fileName + " length = " + file.length());
+	 	// insert a streaming column
+	 	ps.setInt(1, intValue);
+	 	ps.setAsciiStream(2, fileIn, (int)file.length());
+		//for varchars, trailing blank truncation will not throw an exception. Only non-blank characters cause truncation error
+		//for long varchars, any character truncation will throw an exception.
+	 	try {
+			ps.executeUpdate();
+			System.out.println("No truncation and hence no error");
+	 	}
+	 	catch (SQLException e) {
+			if (file.length() > maxValueAllowed && e.getSQLState().equals("22001")) //truncation error
+				System.out.println("expected exception for data > " + maxValueAllowed + " in length");
+			else
+				dumpSQLExceptions(e);
+	 	}
+	 	fileIn.close();
+	}
+
+	static void verifyLength(int a, int columnSize, long[] fileLength)
+	{
+		for (int i = 0; i < fileLength.length; i++) {
+			if ((a == (100 + i)) || (a == (10000 + i)))
+			{
+				if(columnSize != fileLength[i])
+					System.out.println("test failed, columnSize should be " + fileLength[i]
+					   + ", but it is " + columnSize + ", i = " + i);
+				else
+					System.out.println("===> verified length " + fileLength[i]);
+			}
+		}
+	}
+
+	static void verifyExistence(Connection conn, int key, String base, long length) throws Exception {
+		if (!pad(base, length).equals(getLongString(conn, key)))
+			throw new Exception("failed to find value " + base + "... at key " + key);
+	}
+
+	static String getLongString(Connection conn, int key) throws Exception {
+		Statement s = conn.createStatement();
+		ResultSet rs = s.executeQuery("select b from foo where a = " + key);
+		if (!rs.next())
+			throw new Exception("there weren't any rows for key = " + key);
+		String answer = rs.getString(1);
+		if (rs.next())
+			throw new Exception("there were multiple rows for key = " + key);
+		rs.close();
+		s.close();
+		return answer;
+	}
+
+	static String pad(String base, long length) {
+		StringBuffer b = new StringBuffer(base);
+		for (long i = 1; b.length() < length; i++)
+			b.append(" " + i);
+		return b.toString();
+	}
+
+	static int insertLongString(Connection conn, int key, String data, boolean binaryColumn) throws Exception {
+		PreparedStatement ps = conn.prepareStatement("insert into foo values(" + key + ", ?)");
+		return streamInStringCol(ps, data, binaryColumn);
+	}
+
+	static int updateLongString(Connection conn, int oldkey, int newkey)
+		 throws Exception
+	{
+		PreparedStatement ps = conn.prepareStatement(
+			"update foo set a = ?, b = ? where a = " + oldkey);
+
+		String updateString = pad("", newkey);
+		ByteArrayInputStream bais = new ByteArrayInputStream(updateString.getBytes());
+		ps.setInt(1, newkey);
+		ps.setAsciiStream(2, bais, updateString.length());
+		int nRows = ps.executeUpdate();
+		ps.close();
+		return nRows;
+	}
+
+	static int streamInStringCol(PreparedStatement ps, String data, boolean binaryColumn) throws Exception {
+		int nRows = 0;
+
+		if (data == null)
+		{
+			ps.setAsciiStream(1, null, 0);
+			nRows = ps.executeUpdate();
+		}
+		else
+		{
+			ByteArrayInputStream bais = new ByteArrayInputStream(data.getBytes("US-ASCII"));
+			if (binaryColumn)
+				ps.setBinaryStream(1, bais, data.length());
+			else
+				ps.setAsciiStream(1, bais, data.length());
+			nRows = ps.executeUpdate();
+			bais.close();
+		}
+		return nRows;
+	}
+
+	public static int streamInLongCol(PreparedStatement ps, Object data) throws Exception {
+		String s = (String)data;
+		ByteArrayInputStream bais = new ByteArrayInputStream(s.getBytes());
+		ps.setAsciiStream(1, bais, s.length());
+		int nRows = ps.executeUpdate();
+		bais.close();
+		return nRows;
+	}
+
+	/**
+		Compare two byte arrays using value equality.
+		Two byte arrays are equal if their length is
+		identical and their contents are identical.
+	*/
+	private static boolean byteArrayEquals(
+    byte[] a,
+    int aOffset,
+    int aLength,
+    byte[] b,
+    int bOffset,
+    int bLength)
+    {
+		if (aLength != bLength)
+			return false;
+
+		for (int i = 0; i < aLength; i++) {
+			if (a[i + aOffset] != b[i + bOffset])
+				return false;
+		}
+		return true;
+	}
+
+	static private void dumpSQLExceptions (SQLException se) {
+		System.out.println("FAIL -- unexpected exception: " + se.toString());
+		se.printStackTrace();
+		while (se != null) {
+			System.out.print("SQLSTATE("+se.getSQLState()+"):");
+			se = se.getNextException();
+		}
+	}
+}

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+supportfiles=tests/store/short.data,tests/store/shortbanner,tests/store/derby.banner,tests/store/empty.data,tests/store/char32703.data,tests/store/char32703trailingblanks.data,tests/store/char32675.data,tests/store/char32675trailingblanks.data
+usedefaults=true
+jvmflags=-ms32M -mx128M
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/streamingColumn_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,8 @@
+derby.storage.sortBufferMax=5
+derby.debug.true=testSort
+
+derby.drda.debug=true
+derby.drda.traceAll=true
+derby.stream.error.logSeverityLevel=0
+derby.language.logStatementText=true
+derby.infolog.append=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeCursorLocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeCursorLocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeCursorLocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,440 @@
+-- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select a from a;
+select * from a;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=-3000 where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=30 where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=-30,c='-three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=-50,c='-five' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=30,c='three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=3030,c='threethree' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+-------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeHoldCursorLocksJDBC30.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeHoldCursorLocksJDBC30.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeHoldCursorLocksJDBC30.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,439 @@
+-- Very basic single user testing of btree cursor update locks.  This ".subsql"
+-- test is meant to be run from another test such that it gets run under 
+-- multiple isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, which exits in middle of scan.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select a from a;
+select * from a;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=-3000 where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test exact match cursor scan does one update, and bales early. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -3000, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a = 3 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=30 where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= 1 and a < 20 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=-30,c='-three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=-50,c='-five' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a > 0 and b < 0 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified exact match cursor scan which deletes one row.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a = 1 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a from a where a <> 3 and a <> 5 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get with hold cursor scan_cursor as
+    'select a,b,c from a where a > 2 and a <= 5 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=30,c='three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update of b, c';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set b=3030,c='threethree' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+-------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeSetLocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeSetLocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateBtreeSetLocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,246 @@
+-- Very basic single user testing of update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- This test concentrates on updates which use a primary index for the cursor,
+-- and then update a non-key field, or delete a row.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar, d somesortofpad);
+--     create index a_idx on (a, somesortofpad) 
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--------------------------------------------------------------------------------
+select a, b, c from a;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which deletes exact match on a.
+--------------------------------------------------------------------------------
+delete from a where a = 4;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select a from a;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select a from a;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where (a = 2 or a = 4 or a = 6) and (b < 8);
+
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test updates an exact match on a.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 300 where a = 3;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test updates an exact match on a with base row qualification necessary.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 300, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = 30 where a = 3 and b = 300;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a  set b = -b where a >= 3 and a < 6;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test exact match which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+delete from a  where a = 2;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+update a  set b = -b where a = 2;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+delete from a  where a > 0 and b < -1000;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a  where a = 1 or a = 7;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, '-three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+
+update a  set b = 30 where a > 2 and a < 5;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+
+update a  set b = 3030 where a > 2 and a < 5;
+delete from a where a = 5;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+-------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 3, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatecursorlocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatecursorlocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatecursorlocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,332 @@
+-- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a < 0 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=3,b=30,c='three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get cursor scan_cursor as
+    'select a, b, c from a where a >= -5 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+-------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateholdcursorlocksJDBC30.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateholdcursorlocksJDBC30.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updateholdcursorlocksJDBC30.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,332 @@
+-- Very basic single user testing of update locks on cursors on heap tables.  
+-- This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates.
+--    Should claim a "U" lock as it visits each row.  In serializable it
+--    will convert the lock to S when it moves off the row, having done no
+--    update.  In read committed it will release each U lock as it moves off
+--    the row.
+--
+--    Note that the current implementation claims a IX table lock when doing
+--    update locking, which it will not release even if no actual update is
+--    performed.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which deletes "even" rows.
+--     Will claim an U lock as it visits each row.  Will claim an X lock on any
+--     row it actually deletes.
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which does no updates, now there are committed
+-- deleted rows in the heap, make sure there are no locks on the committed
+-- deleted rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.  Will get X locks only on the rows
+-- which are updated.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=-3,b=-30,c='-three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=-5,b=-50,c='-five' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a < 0 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a > 0 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- -3, -30, '-three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=3,b=30,c='three' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- -5, -50, '-five'
+--------------------------------------------------------------------------------
+
+get with hold cursor scan_cursor as
+    'select a, b, c from a where a >= -5 for update';
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+update a set a=33,b=3030,c='threethree' where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+next scan_cursor;
+delete from a where current of scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+close scan_cursor;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+-------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+select * from a;
+commit;
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocks.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocks.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocks.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,818 @@
+-- Very basic single user testing of update row locking.
+run resource 'createTestProcedures.subsql';
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+
+autocommit off;
+run resource 'LockTableQuery.subsql';
+commit;
+
+-- READ COMMITTED TEST
+set current isolation read committed;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+commit;
+
+-- REPEATABLE READ TEST
+--   should be the same as SERIALIZABLE results except no previous key locks.
+
+set isolation rs;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+        -- create table a (a int, b int, c varchar(1900));
+            
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+
+commit;
+
+-- SERIALIZABLE TEST
+set isolation serializable;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+    	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+        -- to create tables of page size 4k and still keep the following tbl 
+	-- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+   create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+
+commit;
+
+-- READ UNCOMMITTED TEST (for update tests should act just like read committed).
+set isolation read uncommitted;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+        
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatecursorlocks.subsql';
+
+-- non cursor, no index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900)) ;
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updatesetlocks.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeCursorLocks.subsql';
+
+-- non cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(800) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',800));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',800));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',800));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',800));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',800));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',800));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',800));
+    create unique index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+-- non cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(900) ) ;
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',900));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',900));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',900));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',900));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',900));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',900));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',900));
+    create index a_idx on a (a, index_pad) ;
+    commit;
+    run resource 'updateBtreeSetLocks.subsql';
+
+
+commit;
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,339 @@
+-- Very basic single user testing of update row locking.
+
+run resource 'createTestProcedures.subsql';
+autocommit off;
+run resource 'LockTableQuery.subsql';
+commit;
+
+-- READ COMMITTED TEST
+set isolation read committed;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updateholdcursorlocksJDBC30.subsql';
+
+
+-- cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900); 
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+    create table a(a int, b int, c varchar(1900));
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updateholdcursorlocksJDBC30.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) );
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) );
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+
+commit;
+
+-- REPEATABLE READ TEST
+--   should be the same as SERIALIZABLE results except no previous key locks.
+
+set isolation RS;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+    create table a(a int, b int);
+    alter table a add column  c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updateholdcursorlocksJDBC30.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+    create table a (a int, b int, c varchar(1900));
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updateholdcursorlocksJDBC30.subsql';
+
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) );
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) );
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+commit;
+
+-- SERIALIZABLE TEST
+set isolation serializable;
+commit;
+
+-- run each test with rows on one page in the interesting conglomerate (heap in
+-- the non-index tests, and in the index in the index based tests).
+
+-- cursor, no index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    commit;
+    run resource 'updateholdcursorlocksJDBC30.subsql';
+
+
+-- cursor, unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create unique index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    -- to create tables of page size 4k and still keep the following tbl 
+    -- create table a (a int, b int, c varchar(1900));
+    
+    create table a(a int, b int);
+    alter table a add column c varchar(1900);
+    insert into a values (1, 10, 'one');
+    insert into a values (2, 20, 'two');
+    insert into a values (3, 30, 'three');
+    insert into a values (4, 40, 'four');
+    insert into a values (5, 50, 'five');
+    insert into a values (6, 60, 'six');
+    insert into a values (7, 70, 'seven');
+    create index a_idx on a (a);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- run each test with rows across multiple pages in the interesting 
+-- conglomerate (heap in the non-index tests, and in the index in the index 
+-- based tests).
+
+-- cursor, no index run
+    drop table a;
+    call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+    create table a (a int, b int, c varchar(1900));
+    insert into a values (1, 10, PADSTRING('one',1900));
+    insert into a values (2, 20, PADSTRING('two',1900));
+    insert into a values (3, 30, PADSTRING('three',1900));
+    insert into a values (4, 40, PADSTRING('four',1900));
+    insert into a values (5, 50, PADSTRING('five',1900));
+    insert into a values (6, 60, PADSTRING('six',1900));
+    insert into a values (7, 70, PADSTRING('seven',1900));
+    commit;
+    run resource 'updateholdcursorlocksJDBC30.subsql';
+
+-- cursor, unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(600) );
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',600));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',600));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',600));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',600));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',600));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',600));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',600));
+    create unique index a_idx on a (a, index_pad);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+-- cursor, non-unique index run
+    drop table a;
+    create table a (a int, b int, c varchar(1900), index_pad varchar(700) );
+    insert into a values (1, 10, PADSTRING('one',1900), PADSTRING('index pad 1',700));
+    insert into a values (2, 20, PADSTRING('two',1900), PADSTRING('index pad 2',700));
+    insert into a values (3, 30, PADSTRING('three',1900), PADSTRING('index pad 3',700));
+    insert into a values (4, 40, PADSTRING('four',1900), PADSTRING('index pad 4',700));
+    insert into a values (5, 50, PADSTRING('five',1900), PADSTRING('index pad 5',700));
+    insert into a values (6, 60, PADSTRING('six',1900), PADSTRING('index pad 6',700));
+    insert into a values (7, 70, PADSTRING('seven',1900), PADSTRING('index pad 7',700));
+    create index a_idx on a (a, index_pad);
+    commit;
+    run resource 'updateBtreeHoldCursorLocksJDBC30.subsql';
+
+
+commit;
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatelocksJDBC30_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,6 @@
+usedefaults=true
+runwithjdk13=false
+runwithibm13=false
+runwithj9=false
+excludeJCC=1.1
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatesetlocks.subsql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatesetlocks.subsql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/updatesetlocks.subsql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,214 @@
+-- Very basic single user testing of heap set query update locks.  This ".subsql" test is
+-- meant to be run from another test such that it gets run under multiple
+-- isolation levels.  This is important for update locks as they behave
+-- differently, depending on isolation levels.
+--
+-- assume's caller has already done: run 'LockTableQuery.subsql'; to get 
+-- easy access to the lock VTI.
+
+autocommit off;
+
+--------------------------------------------------------------------------------
+-- Assumes that calling routine has set up the following simple dataset, 
+-- a heap, no indexes with following initial values:
+--     create table (a int, b int, c somesortofchar);
+-- 1, 10, 'one'
+-- 2, 20, 'two'
+-- 3, 30, 'three'
+-- 4, 40, 'four'
+-- 5, 50, 'five'
+-- 6, 60, 'six'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This can
+-- be done with a single call to store pushing the qualifier down.
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.  This has to
+-- be deferred as the update may change the values in the qualifer.
+--------------------------------------------------------------------------------
+update a set a = -a, b = -b where a = -42;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full scan which deletes "even" rows.
+--------------------------------------------------------------------------------
+delete from a where a = 2 or a = 4 or a = 6;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full heap scan which does a delete which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where a = -42;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test full heap scan which does an update which does not qualify.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = -42;
+
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+
+--------------------------------------------------------------------------------
+-- Test full cursor scan which updates the middle 2 rows, now there are 
+-- committed deleted rows in the heap.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, 30, 'three'
+-- 5, 50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = -b where a = 3 or a = 5;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which does no updates. 
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+update a set b = 4000 where a < 0;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which deletes the positive rows.
+-- 
+-- At this point the table should look like:
+-- 1, 10, 'one'
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+-- 7, 70, 'seven'
+--------------------------------------------------------------------------------
+delete from a where b > 0;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row.
+-- 
+-- At this point the table should look like:
+-- 3, -30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+
+update a set b = -b, c = 'three' where a > 2 and a < 5;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+--------------------------------------------------------------------------------
+-- Test qualified full cursor scan which updates a row and deletes a row.
+--
+-- can't be done is one set statement, do 2 statements.
+-- 
+-- At this point the table should look like:
+-- 3, 30, 'three'
+-- 5, -50, 'five'
+--------------------------------------------------------------------------------
+
+update a set a=33,b=3030,c='threethree' where a = 3;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+delete from a where a = 5;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+
+commit;
+select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+commit;
+
+select * from a;
+commit;
+
+-------------------------------------------------------------------------------
+-- At this point the table should look like:
+-- 33, 3030, 'threethree'
+--------------------------------------------------------------------------------
+
+drop table a;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+-- Use a valid attribute, but do not display message.
+connect 'jdbc:derby:wombat;dataEncryption=true';
+-- Find an unknown attribute.
+connect 'jdbc:derby:wombat;unknown=x';
+-- Check for duplicate.
+connect 'jdbc:derby:wombat;dataEncryption=true;dataEncryption=false';
+-- Perform case check.
+connect 'jdbc:derby:wombat;dataencryption=true';
+-- Check for true/false.
+connect 'jdbc:derby:wombat;dataEncryption=x';

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/URLCheck_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+ij.protocol=jdbc:derby:
+ij.database=jdbc:derby:wombat;create=true
+ij.showNoConnectionsAtStart=true

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/copyfiles.ant	Tue Jan 11 11:53:57 2005
@@ -5,3 +5,28 @@
 dblook_test.jar
 dblook_test_app.properties
 dblook_test_sed.properties
+iepnegativetests.sql
+iepnegativetests_app.properties
+ieptests.sql
+ieptests_app.properties
+importExportThruIJ.sql
+importExportThruIJ_app.properties
+importExport_app.properties
+importExport_sed.properties
+ij.sql
+ij2.sql
+ij2_app.properties
+ij2_derby.properties
+ij3.sql
+ij3_app.properties
+ij4.sql
+ij4_app.properties
+ij5.sql
+ij5_app.properties
+ij6.sql
+ij6_app.properties
+ijConnName.sql
+ijConnName_app.properties
+ij_app.properties
+URLCheck.sql
+URLCheck_app.properties

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,227 @@
+--testing error cases for import/export
+create schema iep;
+create table iep.t1(a int);
+insert into iep.t1 values(100) , (101) , (102) , (103) , (104) , (105) , (106);
+--export error cases
+--export can not create file
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'nodir/t1.dat' , 
+                                 null, null, null) ;
+--export table not found
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 'NOTABLE' , 'extinout/t1.dat' , 
+                                 null, null, null) ;
+---export schema is not valid
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('XXXX', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null) ;
+--export query is invalid (syntax error)
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select from t1', 
+                                    'extinout/t1.dat' , null, null, null) ;
+
+--export codeset is invalid
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from iep.t1', 
+                                    'extinout/t1.dat' , null, null, 'NOSUCHCODESET') ;
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('XXXX', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null) ;
+--export delimiter errror cases
+--period can not be used as character ot column delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, '.', null) ;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '.', null, null) ;
+
+--same delimter can not be used as character and column delimters
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 ';', ';', null) ;
+
+--space character can not be a delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 ' ', ';', null) ;
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, ' ', null) ;
+
+--if emtry strinng is passed actual value delimiter should be space
+--and the that should become a invalid delimiter 
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '', ';', null) ;
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, '', null) ;
+
+
+--more than one character passed to the delimiters get truncated to one
+--following one should give error because eventually '\' delimiter 
+--is used a both for char and col
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '\a', '\', null) ;
+
+
+--DO A VALID EXPORT AND  IMPORT 
+set schema iep;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, null, 'utf-8') ;
+delete from t1 ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null, 0) ;
+select * from t1;
+
+--import error cases
+--import can not find input file
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE('iep', 't1' , 'nodir/t1.dat' , 
+                                 null, null, null, 0) ;
+--import table not found
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 'NOTABLE' , 'extinout/t1.dat' , 
+                                 null, null, null, 0) ;
+--import schema is not valid
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('XXXX', 't1' , 'extinout/t1.dat' , 
+                                 null, null, null, 0) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, null, 'INCORRECTCODESET', 0) ;
+
+--check import with invalid delimiter usage
+--if emtry strinng is passed actual value delimiter should be space
+--and the that should become a invalid delimiter 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 '', ';', null, 0) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 null, '', null, 0) ;
+
+--same delimter can not be used as character and column delimters
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't1' , 'extinout/t1.dat' , 
+                                 ';', ';', null, 1) ;
+
+
+autocommit off;
+create table v1(a int) ;
+declare global temporary table session.temp1(c1 int) on commit preserve rows not logged;
+insert into session.temp1 values(1) , (2) , (3) , (4) , (5) , (6);
+select * from session.temp1;
+--export to from a temporary table
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('session', 'temp1' , 'extinout/temp1.dat' , 
+      
+                           null, null, null) ;
+-- because temporary table has on commit preserve rows, commit issued by export will not delete data from the temp table.
+select * from session.temp1;
+--import back to a regualr table
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 'v1' , 'extinout/temp1.dat' , 
+                                 null, null, null, 0) ;
+select * from v1;
+commit;
+--import to a temp table should fail with a table not found errror
+declare global temporary table session.temp2(c1 int) not logged;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('session', 'temp2' , 'extinout/temp1.dat' , 
+                                 null, null, null, 0) ;
+
+select * from session.temp2 ;
+commit ;
+drop table v1;
+autocommit on;
+
+create table t3(c1 int , c2 double , c3 decimal , c4 varchar(20) );
+insert into t3 values(1 , 3.5 , 8.6 , 'test strings');
+insert into t3 values(2 , 3.5 , 8.6 , 'test strings');
+insert into t3 values(3 , 3.5 , 8.6 , 'test strings');
+insert into t3 values(4 , 3.5 , 8.6 , 'test strings');
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't3' , 'extinout/t3.dat' , 
+                                 null, null, null) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 't3' , 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+select * from t3;
+
+--import data column names are incorrect
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3, x4', null,
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3', '1,2,3,4', 
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+
+--import data insert column names count < column indexes does not match
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'c1, c2, c3', '1,2,3,4', 
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+--import data column indexes count > insert columns count
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'c1, c2, c3,c4', '1,2', 
+                                 'extinout/t3.dat' , 
+                                 null, null, null, 0) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , null, '11,22,12,24', 
+                                 'extinout/t3.dat' , 
+				 null, null, null, 0) ;
+
+
+--repeat the above type cases with empty file and minor variation to paramters
+delete from t3 ;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 't3' , 'extinout/t3.dat' , 
+                                  ';', '^', 'utf-16') ;
+--import data column names are incorrect
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3, x4', null, 
+                                 'extinout/t3.dat' , 
+                                 ';', '^', 'utf-16', 1) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'x1, x2, x3', '1,2,3,4', 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+
+--import data insert column names count < column indexes does not match
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , 'c1, c2, c3', null, 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+--import data column indexes count > insert columns count
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , null, '1,2', 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+
+
+--specify column indexes that are not there in the file that is being  imported
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 't3' , null, '11,22,12,24', 
+                                 'extinout/t3.dat' , 
+				    ';', '^', 'utf-16', 1) ;
+
+
+--import to a system table shoud fail
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('SYS', 'SYSTABLES' , 'extinout/t3.dat' , 
+                                      ';', '^', 'utf-16', 1) ;
+
+
+---not supported by db2 cloudscape import/export
+create table ntype(a int , ct CLOB(1024));
+create table ntype1(bt BLOB(1024) , a int);
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('iep', 'ntype' , 'extinout/ntype.dat' , 
+                                 null, null, null) ;
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from iep.ntype1',
+				   'extinout/ntype.dat' , 
+                                   null, null, null) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE ('iep', 'ntype' , 'extinout/ntype.dat' , 
+                                 null, null, null, 0) ;
+call SYSCS_UTIL.SYSCS_IMPORT_DATA('iep', 'ntype1' , null , null, 
+                                 'extinout/ntype.dat' , 
+                                 null, null, null, 0) ;
+
+--import should aquire a lock on the table
+create table parent(a int not null primary key);
+insert into parent values (1) , (2) , (3) , (4) ;
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from parent where a < 3' , 'extinout/parent.del' , 
+                                 null, null, null) ;
+connect 'jdbc:derby:wombat' as c1;
+connect 'jdbc:derby:wombat' as c2;
+set connection c1;
+autocommit off;
+lock table iep.parent in share mode;
+set connection c2;
+autocommit off;
+--following import should fail with lock time out
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.locks.waitTimeout', '5');
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE('iep', 'parent', 'extinout/parent.del',null, null, null,1);
+disconnect c1;
+disconnect c2;
+
+set connection connection0;
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/iepnegativetests_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2 @@
+usedefaults=true
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,421 @@
+--table used for export
+create table ex_emp(id int , name char(7) , skills varchar(200), salary decimal(10,2)) ;
+--table used for import
+create table imp_emp(id int , name char(7), skills varchar(200), salary decimal(10,2)) ;
+--After an export from ex_emp and import to imp_emp both tables should have 
+--same data.
+--double delimter cases with default character delimter "
+--field seperator character inside a double delimited string as first line
+insert into ex_emp values(99, 'smith' , 'tennis"p,l,ayer"', 190.55) ;
+-- Perform Export:
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 null, null, null) ;
+-- Perform Import
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                      null, null, null, 0) ;
+
+insert into ex_emp values(100, 'smith' , 'tennis"player"', 190.55) ;
+insert into ex_emp values(101, 'smith' , 'tennis"player', 190.55) ;
+insert into ex_emp values(102, 'smith' , '"tennis"player', 190.55) ;
+insert into ex_emp values(103, 'smith' , '"tennis"player"', 190.55) ;
+insert into ex_emp values(104, 'smith' , '"tennis"""""""""""""""""""""""""""""""""""""player"', null) ;
+--empty string
+insert into ex_emp values(105, 'smith' , '""', 190.55) ;
+--just delimeter inside 
+insert into ex_emp values(106, 'smith' , '"""""""""""""""""""', 190.55); 
+--null value
+insert into ex_emp values(107, 'smith"' , null, 190.55) ;
+--all values are nulls
+insert into ex_emp values(108, null , null, null) ;
+
+-- Perform Export:
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 null, null, null) ;
+-- Perform Import
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                      null, null, null, 0) ;
+
+select * from ex_emp;
+select * from imp_emp;
+--checking query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+
+
+
+delete from imp_emp where id < 105;
+--export from ex_emp using the a query only rows that got deleted in imp_emp 
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from ex_emp where id < 105', 
+                                    'extinout/emp.dat' , null, null, null) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                      null, null, null, 0) ;
+
+--checking query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+
+
+--export the columns in different column order than in the table.
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select name , salary , skills, id from ex_emp where id < 105', 
+                                    'extinout/emp.dat' , null, null, null) ;
+
+-- import them in to a with order different than in the table;
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,'name, salary, skills, id', null,
+                                    'extinout/emp.dat', null, null, null, 1) ;
+--check query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+
+
+-- do import replace into the table with table order but using column indexes
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,null, '4, 1, 3, 2',
+                                    'extinout/emp.dat', null, null, null, 1) ;
+
+--check query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+
+--replace using insert column names and column indexes
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_emp' ,'salary, id, skills, name', '2, 4, 3, 1',
+                                    'extinout/emp.dat', null, null, null, 1) ;
+
+--check query
+select count(*) from imp_emp, ex_emp
+      where ex_emp.id = imp_emp.id and
+      (ex_emp.skills=imp_emp.skills or
+      (ex_emp.skills is NULL and imp_emp.skills is NULL));
+
+
+---testing with different delimiters
+-- single quote(') as character delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                    null, '''', null) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                    null, '''', null, 1) ;
+
+select * from imp_emp ;
+
+-- single quote(') as column delimiter
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                    '''',null, null) ;
+delete from imp_emp ;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'imp_emp' , 'extinout/emp.dat' , 
+                                    '''', null, null, 0) ;
+select * from imp_emp;
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 '*', '%', null) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ex_emp' , 'extinout/emp.dat' , 
+                                 '*', '%', null, 1) ;
+
+select * from imp_emp ;
+
+--cases for identity columns
+--create table emp1(id int generated always as identity (start with 100), name char(7), 
+--              skills varchar(200), salary decimal(10,2),skills varchar(200));
+
+
+--check import export with real and double that can not be explictitly
+--casted from VARCHAR type .
+
+create table noncast(c1 double , c2 real ) ;
+insert into noncast values(1.5 , 6.7 ) ;
+insert into noncast values(2.5 , 8.999) ;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE ('APP' , 'noncast' , 'extinout/noncast.dat'  , null , null , null) ;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'noncast' , 'extinout/noncast.dat'  , null , null , null , 0) ;
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'noncast', 'c2 , c1' , '2, 1' , 
+                                   'extinout/noncast.dat'  , null , null , null , 0) ;
+select * from noncast ;
+
+--check import/export of time types
+
+CREATE TABLE   TTYPES(DATETYPE DATE, TIMETYPE TIME, TSTAMPTYPE TIMESTAMP );
+insert into ttypes values('1999-09-09' , '12:15:19' , '1999-09-09 11:11:11' );
+insert into ttypes values('2999-12-01' , '13:16:10' , '2999-09-09 11:12:11' );
+insert into ttypes values('3000-11-02' , '14:17:21' , '4999-09-09 11:13:11' );
+insert into ttypes values('2004-04-03' , '15:18:31' , '2004-09-09 11:14:11' );
+insert into ttypes values(null , null , null);
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'ttypes' , 'extinout/ttypes.del' , 
+                                 null, null, null) ;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'ttypes' , 'extinout/ttypes.del' , 
+                                 null, null, null, 0) ;
+
+select * from ttypes;
+
+
+
+
+---Import should commit on success and rollback on any failures
+autocommit off ;
+create table t1(a int ) ;
+insert into t1 values(1) ;
+insert into t1 values(2) ;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null) ;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+--above import should have committed , following rollback should be a noop.
+rollback;
+select * from t1;
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+--file not found error should rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/nofile.del' , 
+                                 null, null, null, 0) ;
+commit;
+select * from t1 ;
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+--table not found error should issue a implicit rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'notable' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+commit ;
+select * from t1 ;
+delete from t1;
+---check commit/rollback with replace options using 
+insert into t1 values(1) ;
+insert into t1 values(2) ;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null) ;
+--above export should have a commit.rollback below should be a noop
+rollback;
+select * from t1;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null, 1) ;
+--above import should have committed , following rollback should be a noop.
+rollback;
+select * from t1;
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+--file not found error should rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 't1' , 'extinout/nofile.del' , 
+                                 null, null, null, 1) ;
+commit;
+select * from t1 ;
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+--table not found error should issue a implicit rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'notable' , 'extinout/t1.del' , 
+                                 null, null, null, 1) ;
+commit ;
+---check IMPORT_DATA calls commit/rollback
+select * from t1 ;
+delete from t1;
+---check commit/rollback with replace options using 
+insert into t1 values(1) ;
+insert into t1 values(2) ;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 't1' , 'extinout/t1.del' , 
+                                 null, null, null) ;
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1' , 'a' , '1' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+--above import should have committed , following rollback should be a noop.
+rollback;
+select * from t1;
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+--file not found error should rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1', 'a' , '1'  , 'extinout/nofile.del' , 
+                                 null, null, null, 0) ;
+commit;
+select * from t1 ;
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+--table not found error should issue a implicit rollback 
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'notable' , 'a' , '1', 'extinout/t1.del' , 
+                                 null, null, null, 1) ;
+commit ;
+select * from t1 ;
+
+autocommit on ;
+--make sure commit import code is ok in autcommit mode.
+insert into t1 values(3) ;
+insert into t1 values(4) ;
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1' , 'a' , '1' , 'extinout/t1.del' , 
+                                 null, null, null, 0) ;
+select * from t1 ;
+insert into t1 values(5) ;
+insert into t1 values(6) ;
+--following import will back , but should not have any impact on inserts
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 't1', 'a' , '1'  , 'extinout/nofile.del' , 
+                                 null, null, null, 0) ;
+select * from t1 ;
+--END IMPORT COMMIT/ROLLBACK TESTSING
+
+---all types supported by DB2 cloudscape import/export
+create table alltypes(chartype char(20) , 
+	          biginttype bigint , 
+		  datetype date , 
+		  decimaltype decimal(10,5) , 
+		  doubletype double , 
+		  inttype integer , 
+		  lvartype long varchar , 
+		  realtype real , 
+		  sminttype smallint , 
+		  timetype time , 
+		  tstamptype timestamp , 
+		  vartype varchar(50));
+
+insert into  alltypes values('chartype string' ,
+                          9223372036854775807,
+                         '1993-10-29' ,
+                          12345.54321,
+                          10E307,
+                          2147483647,
+                          'long varchar testing',
+                          10E3,
+                          32767,
+                          '09.39.43',
+                          '2004-09-09 11:14:11',
+                          'varchar testing');
+
+insert into  alltypes values('chartype string' ,
+                          -9223372036854775808,
+                         '1993-10-29' ,
+                          0.0,
+                          -10E307,
+                          -2147483647,
+                          'long varchar testing',
+                          -10E3,
+                          32767,
+                          '09.39.43',
+                          '2004-09-09 11:14:11',
+                          'varchar testing');
+
+insert into  alltypes values('"chartype" string' , 
+                              9223372036854775807,
+                             '1993-10-29' , 
+                              -12345.54321,
+                              10E307,
+                              2147483647,
+                              'long "varchar" testing',
+                              10E3,
+                              32767,
+                              '09.39.43',
+                              '2004-09-09 11:14:11',
+                              '"varchar" testing');
+                              
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null) ;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null, 0) ;
+select * from alltypes ;                          
+delete from alltypes;
+
+--import should work with trigger enabled on append and should not work on replace
+create table test1(a char(20)) ;
+create trigger trig_import after INSERT on alltypes
+referencing new as newrow
+for each  row mode db2sql
+insert into test1 values(newrow.chartype);
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null, 0) ;
+select count(*) from alltypes ;
+select * from test1;
+delete from alltypes;
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'alltypes' , 'extinout/alltypes.del' , 
+                                 null, null, null, 1) ;
+select count(*) from alltypes;
+
+drop trigger trig_import;
+drop table test1;
+
+--test importing to identity columns
+create table table1(c1 char(30), 
+       c2 int generated always as identity,
+       c3 real,
+       c4 char(1));
+
+create table table2(c1 char(30), 
+       c2 int,
+       c3 real,
+       c4 char(1));
+
+insert into table2 values('Robert',100, 45.2, 'J');
+insert into table2 values('Mike',101, 76.9, 'K');
+insert into table2 values('Leo',102, 23.4, 'I');
+
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select c1,c3,c4 from table2' , 'extinout/import.del' , 
+                                 null, null, null) ;
+CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(NULL,'table1', 'c1,c3,c4' , null, 'extinout/import.del',null, null,null,0);
+
+select * from table1;
+delete from table1;
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null , 'table2' , 'extinout/import.del',  null, null, null) ;
+
+--following import should fail becuase of inserting into identity column.
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'table1', 'extinout/import.del',null, null, null,1);
+
+--following import should be succesful
+CALL SYSCS_UTIL.SYSCS_IMPORT_DATA(NULL, 'table1', 'c1,c3,c4' , '1,3,4', 'extinout/import.del',null, null, null,1);
+select * from table1;
+
+update table2 set c2=null;
+--check null values import to identity columns should also fail
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null , 'table2' , 'extinout/import.del' , 
+                                 null, null, null) ;
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'table1', 'extinout/import.del',null, null, null,1);
+select * from table1;
+
+--check that replace fails when there dependents and replaced data 
+--does not violate foreign key constraints.
+create table parent(a int not null primary key);
+insert into parent values (1) , (2) , (3) , (4) ;
+create table child(b int references parent(a));
+insert into child values (1) , (2) , (3) , (4) ;
+call SYSCS_UTIL.SYSCS_EXPORT_QUERY('select * from parent where a < 3' , 'extinout/parent.del' , 
+                                 null, null, null) ;
+--replace should fail because of dependent table
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'parent', 'extinout/parent.del',null, null, null,1);
+select * from parent;
+
+---test with a file which has a differen records seperators (\n, \r , \r\n)
+create table nt1( a int , b char(30));
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE(NULL, 'nt1', 'extin/mixednl.del',null, null, null,0);
+select * from nt1;
+drop table nt1 ;
+
+--test case for bug 5977;(with lot of text data)
+create table position_info
+    (
+       position_code varchar(10) not null ,
+       literal_no int not null ,
+       job_category_code varchar(10),
+       summary_description long varchar,
+       detail_description long varchar,
+       web_flag varchar(1)
+    );
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ('APP', 'position_info', 'extin/position_info.del',
+                                    null, null, null, 1);
+select count(*) from position_info ;
+select detail_description from position_info where position_code='AG1000';
+CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE ('APP', 'position_info', 'extinout/pinfo.del',
+                                    null, null, null);
+delete from position_info;
+CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ('APP', 'position_info', 'extinout/pinfo.del',
+                                    null, null, null, 1);
+select count(*) from position_info ;
+select detail_description from position_info where position_code='AG1000';
+
+
+
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ieptests_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+supportfiles=testData/ImportExport/db2ttypes.del,testData/ImportExport/mixednl.del,testData/ImportExport/position_info.del
+usedefaults=true
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,36 @@
+
+-- this test shows the ij commands in use,
+-- and what happens when invalid stuff is entered.
+
+-- no driver loaded yet, detected off of the url
+-- this one is a bad url:
+connect 'cloudscape:wombat';
+-- this one will work.
+connect 'jdbc:derby:wombat';
+
+-- no connection yet, this will fail
+create table t (i int);
+
+-- no table yet, this will fail
+select i from t;
+
+-- invalid syntax ... incomplete statements
+driver;
+connect;
+prepare;
+execute;
+run;
+remove;
+
+-- should fail because procedure is an illegal statement name
+prepare procedure as 'select * from bar';
+
+-- should fail because text is passed on to derby, which
+-- barfs on the unknown statement name. execute procedure is
+-- a foundation 2000 concept
+execute procedure sqlj.install_jar( 'file:c:/p4c/systest/out/DigIt.jar', 'SourceWUs', 1 );
+
+
+-- and, the help output:
+help;
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,93 @@
+
+-- this test shows some ij abilities against an active database
+
+create table t (i int);
+insert into t values (3), (4);
+
+prepare s as 'select * from t';
+execute s;
+
+remove s;
+-- now it won't find s
+execute s;
+
+prepare s as 'select * from t where i=?';
+-- fails, needs parameter
+execute s;
+
+-- works, finds value
+execute s using 'values 3';
+
+prepare t as 'values 3';
+-- same as last execute
+execute s using t;
+
+-- same as last execute
+execute 'select * from t where i=?' using 'values 3';
+
+-- same as last execute
+execute 'select * from t where i=?' using t;
+
+-- param that is not needed gets out of range message
+execute 'select * from t where i=?' using 'values (3,4)';
+
+-- ignores rows that are not needed
+execute 'select * from t where i=?' using 'values 3,4';
+
+-- with autocommit off, extra rows are processed and no warning results
+autocommit off;
+execute 'select * from t where i=?' using 'values 3,4';
+
+execute 'select * from t where i=?' using 'values 3';
+
+autocommit on;
+
+-- will say params not set when no rows in using values
+execute 'select * from t where i=?' using 'select * from t where i=9';
+
+-- will say params not set when using values is not a query
+execute 'select * from t where i=?' using 'create table s (i int)';
+
+-- note that the using part was, however, executed...
+drop table s;
+
+-- bug 5926 - make sure the using clause result set got closed
+drop table t;
+create table t(c1 int);
+insert into t values(1);
+execute 'select * from t where c1=?' using 'select * from t where c1=1';
+drop table t;
+create table t(c1 int);
+insert into t values(1);
+insert into t values(2);
+execute 'select * from t where c1=?' using 'select * from t where c1>=1';
+drop table t;
+
+-- show that long fields now don't take forever...
+
+create table t ( c char(50));
+insert into t values('hello');
+select cast(c as varchar(20)) from t;
+drop table t;
+
+-- show multiconnect ability; db name is wombat, reuse it...
+-- assumes ij.protocol is appropriately set...
+
+connect 'wombat' as wombat;
+
+show connections;
+
+set connection connection0;
+
+show connections;
+
+set connection wombat;
+
+disconnect;
+
+show connections;
+
+set connection connection0;
+
+show connections;
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,10 @@
+#
+# ij2 wants to test the alternate path for driver loading and
+# protocol prefix setting.
+#
+#
+ij.protocol=jdbc:derby:
+database=wombat;create=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_derby.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_derby.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij2_derby.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+derby.infolog.append=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,7 @@
+-- this test shows that ij can detect the driver from the URL.
+-- the ij.properties file sets ij.database and nothing else.
+
+values 'PASS';
+
+-- this test also exercises the shutdown on exit code
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij3_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,8 @@
+#
+# ij3 wants to test an alternate path for driver loading 
+# from URL setting along
+#
+ij.database=jdbc:derby:wombat;create=true
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,14 @@
+connect 'jdbc:derby:wombat;create=true';
+
+-- test maximum display width
+values cast('1' as varchar(512));
+maximumdisplaywidth 40;
+values cast('1' as varchar(512));
+maximumdisplaywidth 400;
+values cast('1' as varchar(512));
+
+-- and, the exit command:
+exit;
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij4_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+# empty file so no default driver or database
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,5 @@
+-- assumes the connections connOne, connTwo are set up already
+-- 1)at the startup time, it will list all the connections
+-- 2)select will now display number of rows selected
+
+select count(*) from sys.systables where 1=0;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij5_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,5 @@
+ij.connection.connOne=jdbc:derby:wombat;create=true
+ij.connection.connTwo=jdbc:derby:lemming;create=true
+
+ij.showNoConnectionsAtStart=false
+ij.showNoCountForSelect=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,4 @@
+-- 1)no  connections made so far at the startup time and hence no information about
+-- connections is displayed
+
+exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij6_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1 @@
+ij.showNoConnectionsAtStart=false

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,25 @@
+-- assumes the connections connOne, connTwo are set up already
+-- and that connThree, connFour failed to be setup correctly (bad URLs)
+
+-- expect connOne to be active
+show connections;
+set connection connOne;
+values 1;
+set connection connTwo;
+values 1;
+-- connThree doesn't exist, it failed at boot time
+set connection connThree;
+-- connFour doesn't exist, it failed at boot time
+set connection connFour;
+-- connTwo is still active
+show connections;
+-- no such connection to disconnect
+disconnect noName;
+disconnect connOne;
+-- connOne no longer exists
+set connection connOne;
+
+disconnect current;
+
+-- see no more connections to use
+show connections;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ijConnName_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,7 @@
+ij.connection.connOne=jdbc:derby:wombat;create=true
+ij.connection.connTwo=jdbc:derby:lemming;create=true
+ij.connection.connThree=jdbc:noone:fruitfly;create=true
+ij.connection.connFour=jdbc:derby:nevercreated
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/ij_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,7 @@
+# the ij test is testing ij functionality, and doesn't want to use the property
+# default driver or connection. So we ensure they are null here.
+driver=
+database=
+
+ij.showNoConnectionsAtStart=true
+ij.showNoCountForSelect=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,439 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.tools.importExport
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.tools;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSetMetaData;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.util.Properties;
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+  This tests import and export utilties. It first creates
+  a temp table T1 and inserts data into it. Then it calls
+  export to export data out from it into a temp file. Then
+  it calls import to read data from the temp file just
+  created. The program goes through the resultset of import
+  and inserts one row at a time into another temp table T2
+  which has same number of columns as T1. Then it compares
+  number of rows in T1 and T2. If the number of rows are same
+  as in T1 then part of the test succedded.
+
+  The second part imports data out from T2 into second temp
+  file and then we compare both the temp files to see if the
+  2 files exactly match
+
+  @author Mamta, Suresht
+ */
+
+
+public class importExport {
+    
+
+	private static Connection conn;
+    private static String currentVersion;
+	private static boolean passed = false;
+
+	public static void main(String[] args) {
+		System.out.println("Test importExport starting");
+
+		try {
+			// use the ij utility to read the property file and
+			// make the initial connection.
+			ij.getPropertyArg(args);
+			conn = ij.startJBMS();
+
+			conn.setAutoCommit(true);
+			setup(true);
+
+
+			//try to import from a file which doesn't exist
+			try {
+				System.out.println("testing non-existing data file");
+				doImport("Z" , "T1" , null , null , null, 0);
+			} catch (Exception ex) {
+				printExceptionMessage(ex);
+			}
+
+			//try to import from a null file
+			try {
+				System.out.println("testing null data file");
+				doImport(null , "T1" , null , null, null, 0);
+			} catch (Exception ex) {
+				printExceptionMessage(ex);
+			}
+
+
+			System.out.println("testing empty table");
+			doImportAndExport("T1",null, null , null);
+
+			System.out.println("testing empty table with Delimited format");
+			doImportAndExport("T1", null, null , "8859_1");
+
+			System.out.println("testing empty table import Field/Char Delimiters");
+			doImportAndExport("T1", "\t", "|" , "8859_1");
+
+			cleanupBeforeNextRun();
+			addDummyRows();
+			System.out.println("testing import/export with default options");
+			doImportAndExport("T1",null, null, null);
+
+			cleanupBeforeNextRun();
+			System.out.println("testing IE with code set 8859_1");
+			doImportAndExport("T1", null, null , "8859_1");
+			
+			cleanupBeforeNextRun();
+			System.out.println("testing IE with delimiter and codeset");
+			doImportAndExport("T1", "\t", "|", "8859_1");
+
+			cleanupBeforeNextRun();
+			System.out.println("testing IE with delimiters(%, &) and Cp1252");
+			doImportAndExport("T1", "%", "&", "Cp1252");
+
+			cleanupBeforeNextRun();
+			System.out.println("testing IE with delimiters(%, &) and UTF-16");
+			doImportAndExport("T1", "%", "&", "UTF-16");
+
+			cleanupBeforeNextRun();
+
+			System.out.println("testing IE with delimiters(^, #) and WRONG ENCODEINGH");
+			try{
+				doImportAndExport("T1", "^", "#", "INAVALID ENCODING");
+			} catch (Exception ex) {
+				printExceptionMessage(ex) ;
+			}
+
+
+			System.out.println("testing datatypes that does not have Export Supprt");
+			try {
+				doExport("T3", null, null , null);
+			} catch (Exception ex) {
+				printExceptionMessage(ex);
+			}
+
+			try {
+				doImport("T1" , "T3" , null , null , null, 0);
+			} catch (Exception ex) {
+				printExceptionMessage(ex);
+			}
+				
+			//test less data case on the seconds line of input that 
+			//should throw end of file exception. 
+			try{
+				doImportFromFile("extin/EndOfFile.txt" , "T4" , null , null , null, 0);
+			}catch (Exception ex) {
+				printExceptionMessage(ex);
+			}
+
+			System.out.println("PASS: finished testing import and export");
+			teardown();
+			System.out.println("PASS: finished cleaning up the temporary objects from database");
+
+			conn.close();
+
+			passed = true;
+
+		} catch (Throwable e) {
+			System.out.println("FAIL: exception thrown:");
+			passed = false;
+			JDBCDisplayUtil.ShowException(System.out,e);
+		}
+
+		if (passed)
+			System.out.println("PASS");
+		System.out.println("Test importExport finished");
+	}
+
+	static void cleanupBeforeNextRun() throws Exception {
+		Statement stmt = conn.createStatement();
+		stmt.execute("delete from t2");
+		stmt.close();
+	}
+
+	static void doImportAndExport(String fromTable, String colDel , 
+								  String charDel, 
+								  String codeset) throws  Exception 
+	{
+
+
+		doExport(fromTable , colDel , charDel , codeset);
+		doImportAndVerify(fromTable, colDel , charDel, codeset,  0);
+		//test with replace
+		doImportAndVerify(fromTable, colDel , charDel, codeset,  1);
+
+	}
+
+	private static void doExport(String fromTable, String colDel , 
+					 String charDel, 
+					 String codeset) throws  Exception 
+	{
+		
+		String expsql = "call SYSCS_UTIL.SYSCS_EXPORT_TABLE (? , ? , ? , ?, ? , ?)";
+		PreparedStatement ps = conn.prepareStatement(expsql);
+		ps.setString(1 , "APP");
+		ps.setString(2, fromTable);
+		ps.setString(3, (fromTable==null ?  fromTable : "extinout/" + fromTable + ".dat" ));
+		ps.setString(4 , colDel);
+		ps.setString(5 , charDel);
+		ps.setString(6 , codeset);
+
+		//perform export
+		ps.execute();
+		ps.close();
+
+	}
+
+	private static void doImport(String fromTable, String toTable, 
+								 String colDel, String charDel , 
+								 String codeset, int replace) throws Exception 
+	{
+
+				
+		String impsql = "call SYSCS_UTIL.SYSCS_IMPORT_TABLE (? , ? , ? , ?, ? , ?, ?)";
+		PreparedStatement ps = conn.prepareStatement(impsql);
+		ps.setString(1 , "APP");
+		ps.setString(2, toTable);
+		ps.setString(3, (fromTable==null ?  fromTable : "extinout/" + fromTable + ".dat" ));
+		ps.setString(4 , colDel);
+		ps.setString(5 , charDel);
+		ps.setString(6 , codeset);
+		ps.setInt(7, replace);
+
+		//perform export
+		ps.execute();
+		ps.close();
+
+	}
+	
+	private static void doImportFromFile(String fileName, String toTable, 
+								 String colDel, String charDel , 
+								 String codeset, int replace) throws Exception 
+	{
+
+				
+		String impsql = "call SYSCS_UTIL.SYSCS_IMPORT_TABLE (? , ? , ? , ?, ? , ?, ?)";
+		PreparedStatement ps = conn.prepareStatement(impsql);
+		ps.setString(1 , "APP");
+		ps.setString(2, toTable);
+		ps.setString(3, fileName);
+		ps.setString(4 , colDel);
+		ps.setString(5 , charDel);
+		ps.setString(6 , codeset);
+		ps.setInt(7, replace);
+
+		//perform export
+		ps.execute();
+		ps.close();
+
+	}
+	
+	static void doImportAndVerify(String fromTable,  String colDel, 
+								  String charDel , String codeset, 
+								  int replace) throws Exception {
+
+		doImport(fromTable , "T2" , colDel , charDel , codeset , replace);
+
+		Statement stmt = conn.createStatement();
+		ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM " + fromTable);
+		rs.next();
+		int numberOfRowsInT1 = rs.getInt(1);
+		rs.close();
+		rs = stmt.executeQuery("SELECT COUNT(*) FROM t2");
+		rs.next();
+		int numberOfRowsInT2 = rs.getInt(1);
+		rs.close();
+		stmt.close();
+		if (numberOfRowsInT1 != numberOfRowsInT2)
+		{
+			System.out.println("FAIL: Expected " + numberOfRowsInT1 + " got " + numberOfRowsInT2 + " rows after import");
+			throw new SQLException("Wrong number of rows returned");
+		}
+
+		doExport("T2" , colDel , charDel , codeset);
+
+		//check whether the  exported files from T1 and T2  are same now.
+		if (diffTwoFiles( "extinout/"+fromTable + ".dat", "extinout/"+"T2.dat")) {
+			throw new SQLException("Export from  " + fromTable + " and T2 don't match.");
+
+		}
+
+	}
+
+	static boolean diffTwoFiles(String file1, String file2) throws Exception {
+
+		InputStream f1 = new BufferedInputStream(new FileInputStream(file1));
+		InputStream f2 = new BufferedInputStream(new FileInputStream(file2));
+
+		int lineNo=1;
+		int o=1;
+		String lineSep = "\n";
+
+		boolean diffed = false;
+		boolean notDone = true;
+
+		int b1, b2;
+
+		while (notDone) {
+			b1 = f1.read();
+			b2 = f2.read();
+			if ((b1 != b2) && (b1 != -1) && (b2 != -1)) {
+				diffed = true;
+				System.out.println(file1 + " " + file2 + " differ: byte " + o + ", line " + lineNo);
+				notDone = false;
+			} else {
+				if (b1 == b2) {
+					if (b1 == -1) {
+						notDone = false;
+					} else
+						if (b1 == (int)lineSep.charAt(0)) {
+							lineNo++;
+						}
+				} else
+					if (b1 == -1) {
+						diffed = true;
+						System.out.println(file1 + " " + file2 + " differ: EOF on " + file1);
+						notDone = false;
+					} else if (b2 == -1) {
+						diffed = true;
+						System.out.println(file1 + " " + file2 + " differ: EOF on " + file2);
+						notDone = false;
+					}
+
+			}
+			o++;
+		}
+		return diffed;
+	}
+
+	static void setup(boolean first) throws Exception {
+		Statement stmt = conn.createStatement();
+
+		if (first) {
+			verifyCount(
+						stmt.executeUpdate("CREATE TABLE T1 (COLUMN1 VARCHAR(5) , COLUMN2 VARCHAR(8) , " +
+										   "COLUMN3 SMALLINT , COLUMN4 CHAR(11) , COLUMN5 DATE , COLUMN6 DECIMAL(5,1) , " +
+										   "COLUMN7 DOUBLE PRECISION , COLUMN8 INT , COLUMN9 BIGINT , COLUMN10 NUMERIC , " +
+										   "COLUMN11 REAL , COLUMN12 SMALLINT , COLUMN13 TIME , COLUMN14 TIMESTAMP , "+
+										   "COLUMN15 SMALLINT , COLUMN16 VARCHAR(1))"), 0);
+			verifyCount(
+						stmt.executeUpdate("CREATE TABLE T2 (COLUMN1 VARCHAR(5) , COLUMN2 VARCHAR(8) , " +
+										   "COLUMN3 SMALLINT, COLUMN4 CHAR(11) , COLUMN5 DATE , COLUMN6 DECIMAL(5,1) , " +
+										   "COLUMN7 DOUBLE PRECISION , COLUMN8 INT , COLUMN9 BIGINT , COLUMN10 NUMERIC , " +
+										   "COLUMN11 REAL , COLUMN12 SMALLINT , COLUMN13 TIME , COLUMN14 TIMESTAMP , "+
+										   "COLUMN15 SMALLINT , COLUMN16 VARCHAR(1))"), 0);
+			verifyCount(
+						stmt.executeUpdate("CREATE TABLE T3 (C1 BLOB)"), 0);
+			verifyCount(
+						stmt.executeUpdate("create table T4 (   Account int,    Fname   char(30),"+
+                        "Lname   char(30), Company varchar(35), Address varchar(40), City    varchar(20),"+
+ 					   "State   char(5), Zip     char(10), Payment decimal(8,2), Balance decimal(8,2))"),0);
+			
+		} else {
+			verifyBoolean( stmt.execute("DELETE FROM t1"), false);
+		}
+		stmt.close();
+	}
+
+	static void addDummyRows() throws Exception {
+		Statement stmt = conn.createStatement();
+
+		verifyCount(
+					stmt.executeUpdate("INSERT INTO T1 VALUES (null,'aa',1,'a',DATE('1998-06-30'),"+
+									   "1,1,1,1,1,1,1,TIME('12:00:00'),TIMESTAMP('1998-06-30 12:00:00.0'),1,'a')"),1);
+
+		verifyCount(
+					stmt.executeUpdate("INSERT INTO T1 VALUES (null,'bb',1,'b',DATE('1998-06-30'),"+
+									   "2,2,2,2,2,2,2,TIME('12:00:00'),TIMESTAMP('1998-06-30 12:00:00.0'),2,'b')"),1);
+
+		verifyCount(
+					stmt.executeUpdate("INSERT INTO T1 VALUES (null,'cc',1,'c',DATE('1998-06-30'),"+
+									   "3,3,3,3,3,3,3,TIME('12:00:00'),TIMESTAMP('1998-06-30 12:00:00.0'),3,'c')"),1);
+
+		verifyCount(
+					stmt.executeUpdate("INSERT INTO T1 VALUES (null,'dd',1,'d',DATE('1998-06-30'),"+
+									   "4,4,4,4,4,4,4,TIME('12:00:00'),TIMESTAMP('1998-06-30 12:00:00.0'),4,'d')"),1);
+
+		System.out.println("PASS: setup complete");
+	}
+
+
+	static void teardown() throws SQLException {
+		Statement stmt = conn.createStatement();
+
+		verifyCount(
+					stmt.executeUpdate("DROP TABLE t1"),
+					0);
+
+		verifyCount(
+					stmt.executeUpdate("DROP TABLE t2"),
+					0);
+
+		stmt.close();
+
+		System.out.println("PASS: teardown complete");
+	}
+
+	static void verifyCount(int count, int expect) throws SQLException {
+		if (count!=expect) {
+			System.out.println("FAIL: Expected "+expect+" got "+count+" rows");
+			throw new SQLException("Wrong number of rows returned");
+		}
+	}
+
+	static void verifyBoolean(boolean got, boolean expect) throws SQLException {
+		if (got!=expect) {
+			System.out.println("FAIL: Expected "+expect+" got "+got);
+			throw new SQLException("Wrong boolean returned");
+		}
+	}
+
+	static void printExceptionMessage(Exception ex) throws Exception 
+	{
+		if (ex instanceof SQLException) {
+			SQLException ie_ex = ((SQLException)ex);
+			
+			while(ie_ex.getNextException() != null)
+			{
+				ie_ex = ie_ex.getNextException();
+			}
+			System.out.println(ie_ex.getMessage());
+		}
+		else
+			throw ex;
+	}
+}
+
+
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,264 @@
+-- test for import export thru command line interface
+
+-- first test basic import functionality
+-- ascii delimited default format
+drop table T1;
+create table T1 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company varchar(35),
+			Address varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+
+create index T1_IndexBalance on T1 (Balance, Account, Company);
+create index T1_IndexFname on T1 (Fname, Account);
+create index T1_IndexLname on T1 (Lname, Account);
+
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1' , 'extin/EndOfFile.txt' , 
+                                    null, null, null, 0) ;
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T1' , 'extin/Tutor1.asc' , 
+                                    null, null, null, 0) ;
+
+values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T1'));
+
+-- ascii Fixed
+drop table T2;
+
+autocommit off;
+create table T2 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company	varchar(35),
+			Address	varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance	decimal(8,2));
+
+create index T2_IndexBalance on T2 (Balance, Account, Company);
+create index T2_IndexFname on T2 (Fname, Account);
+create index T2_IndexLname on T2 (Lname, Account);
+commit;
+--this one should fail becuase this is not the right command to handle fixed formats
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'T2' , 'extin/Tutor2.asc' , 
+                                    null, null, null, 0) ;
+
+values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T2'));
+commit;
+
+-- test remapping
+drop table T3;
+create table T3 (	Lname	char(30),
+			Fname	char(30),
+			Account	int not null primary key,
+			Company varchar(35),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+
+create index T3_indexBalance on T3 (Balance, Company, Account);
+create index T3_indexPayment on T3 (Payment, Company, Account);
+
+--icorrect mapping of file to table ; should give error and rollback
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'T3' , 
+                                  null , '3, 2, 1, 4, 9, 200' ,
+				  'extin/Tutor3.asc' , 
+				  null, null, null, 0) ;
+rollback;
+
+-- table should not be there
+select count(*) from T3;
+
+create table T3 (	Lname	char(30),
+			Fname	char(30),
+			Account	int not null primary key,
+			Company varchar(35),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+
+create index T3_indexBalance on T3 (Balance, Company, Account);
+create index T3_indexPayment on T3 (Payment, Company, Account);
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'T3' ,  
+                                  null , '3, 2, 1, 4, 9, 10' ,
+				  'extin/Tutor3.asc' ,
+				   null, null, null, 0) ;
+commit;
+
+
+values (SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'T3'));
+
+
+-- now check results
+select count(*) from T1;
+select count(*) from T2;
+select count(*) from T3;
+
+select * from T1 where State = 'CA';
+select * from T2 where State = 'CA';
+select * from T3 where Fname = 'Bugs' or Fname = 'Mickey';
+
+select Balance, Account, Company from T1 order by Balance;
+select Balance, Account, Company from T2 order by Balance;
+select Balance, Account, Company from T3 order by Balance;
+--- now check other input formats
+--- this is Tutor1 with RecordSeperator=',', FieldStartDelimiter=(, FieldEndDelimiter=),FieldSeperator=TAB
+autocommit on;
+drop table Alt1;
+create table Alt1 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company varchar(35),
+			Address varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'Alt1' , 'extin/Alt1.asc' , 
+                                      null, null, null, 0) ;
+
+
+select * from Alt1 where State = 'CA';
+select Balance, Account, Company from Alt1 order by Balance;
+
+
+-- this is Tutor1 with some null fields
+
+drop table Alt3;
+create table Alt3 (	Account	int,
+			Fname	char(30),
+			Lname	char(30),
+			Company varchar(35),
+			Address varchar(40),
+			City	varchar(20),
+			State	char(5),
+			Zip	char(10),
+			Payment	decimal(8,2),
+			Balance decimal(8,2));
+
+
+
+call SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'Alt3' , 'extin/Alt3.asc' , 
+                                      null, null, null, 0) ;
+
+
+select * from Alt3 where State = 'CA' or State = 'TX';
+select Balance, Account, Company from Alt3 order by Balance;
+
+-- test remapping
+-- test remapping
+-- following case is commented because data has different seperator than the default one 
+-- enable this case after rearranging the data (-suresht)
+--create table tempAlt3(column1 varchar(1000) , column3 varchar(1000) , column9 varchar(1000));
+
+--call SYSCS_UTIL.SYSCS_IMPORT_DATA (null, 'tempAlt3' , 
+--    				   null , '2,3,9',
+--				   'extin/Alt3.asc' , 
+--				   null, null, null, 0) ;
+--select * from tempAlt3;
+
+---
+---  SQL anywhere table
+---
+drop table sqlAnywhere1;
+create table sqlAnywhere1 (
+	Id	int,
+	Name	varchar(40),
+	Title	varchar(40),
+	Company	varchar(50),
+	Address	varchar(80),
+	City	varchar(30),
+	State	varchar(30),
+	Zip	varchar(30),
+	Country varchar(30),
+	phone1	varchar(50),
+	phone2	varchar(30),
+	email	varchar(80),
+	web	varchar(50));
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'sqlAnywhere1' ,
+                                  null , '1,2,3,4,5,7,8,9,10,11,12,13,14', 
+	 		          'extin/sqlAnywhere1.txt' , 
+				  '|', '''', 'ASCII', 0) ;
+
+	
+select Company, Country from sqlAnywhere1 where country not like 'U%S%A%' and country is not null;
+
+drop table sqlAnywhere2;
+create table sqlAnywhere2 (
+	Fname varchar(30),
+	Lname varchar(30),
+	email varchar(40),
+	phone varchar(30));
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'sqlAnywhere2' , 
+		                  null , '3, 4, 7, 5',
+			          'extin/sqlAnywhere2.txt' , 
+				  '|', '''', 'ASCII', 0) ;
+select count(*) from sqlAnywhere2;
+
+---
+---  MS access text file
+---  default text format is compatible with ours except their record seperator
+---  is CR-LF instead of LF
+--   data does not seem to match above description , only problem I see
+---  is delimiters inside the data , which gets fixed with double delimters
+---  check the intended case -suresht
+
+drop table HouseHoldItem;
+create table HouseHoldItem (
+	Category	int,
+	RoomId		int,
+	Description	varchar(255),
+	Model		varchar(50),
+	ModelId		varchar(50),
+	SerialNumber	varchar(50),
+	DayPurchase	date,
+	PurchasePrice	decimal(8,2),
+	Insured		smallint,
+	Note		varchar(512));
+
+-- import it first with just LF as record seperator, we should be seeing 
+-- ^M's at the end of note field.
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'HouseHoldItem' , 
+				  null , '2,3,4,5,6,7,8,11,14', 
+				  'extin/Access1.txt' , 
+				  null, null, null, 0) ;
+
+select * from HouseHoldItem;
+
+
+
+----
+---- test export 
+----
+
+call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'T1' , 'extinout/t1.dump' , 
+                                    '|','''', 'ASCII') ;
+
+create table  imp_temp(column2 varchar(200), 
+                  column3 varchar(200), 
+                  column4 varchar(200), 
+                  column5 varchar(200),
+                  column6 varchar(200));
+
+call SYSCS_UTIL.SYSCS_IMPORT_DATA(null, 'imp_temp' ,null, '2, 3, 4, 5, 6',
+                                    'extinout/t1.dump', '|', '''', 'ASCII', 0) ;
+
+select * from imp_temp ;
+drop table imp_temp;
+
+
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExportThruIJ_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+supportfiles=testData/ImportExport/sqlAnywhere1.txt,testData/ImportExport/sqlAnywhere2.txt,testData/ImportExport/Access1.txt,testData/ImportExport/Access2.txt,testData/ImportExport/Access3.txt,testData/ImportExport/Alt1.asc,testData/ImportExport/Alt2.asc,testData/ImportExport/Alt3.asc,testData/ImportExport/Alt4.asc,testData/ImportExport/Alt5.asc,testData/ImportExport/Alt6.asc,testData/ImportExport/Tutor1.asc,testData/ImportExport/Tutor2.asc,testData/ImportExport/Tutor3.asc,testData/ImportExport/EndOfFile.txt
+usedefaults=true
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_app.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_app.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_app.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+supportfiles=testData/ImportExport/EndOfFile.txt
+usedefaults=true
+useextdirs=true

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_sed.properties
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_sed.properties?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/importExport_sed.properties	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,11 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+---------------------------------------------------------------------------------
+# needed for j9 jvm for jartests only...
+substitute=java.lang.ExceptionInInitializerError: java.lang.NullPointerException;java.lang.ExceptionInInitializerError

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/FTFileUtil.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,72 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.util.FTFileUtil
+
+   Copyright 1999, 2004 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.util;
+
+import java.io.FileWriter;
+import java.io.File;
+/**
+  Convience functions for performing file manipulations
+  in ij scripts.
+  */
+public class FTFileUtil
+{ 
+	/**
+	  Create a file.
+
+	  @param name the file's name.
+	  @length the number of bytes of test data in the file.
+	  @exception Exception oops.
+	  */
+	public static void mkFile(String fileName, int length) throws Exception
+	{
+		FileWriter fw = new FileWriter(fileName);
+		int offset = 0;
+		String data = "Amber!";
+		for (int ix=0;ix<length;ix++)
+		{
+			fw.write(data,offset,1);
+			offset++;
+			if (offset >= data.length()) offset = 0;
+		}
+		fw.close();
+	}
+
+	/**
+	   rename a file
+	   @param location location of the file
+	   @param name the file's name
+	   @param newName the file's new name
+	*/
+	public static void renameFile(String location, String name , String newName) throws Exception
+	{
+		File src = new File(location, name);
+		File dst = new File(location, newName);
+		if(!src.renameTo(dst))
+		{
+			throw new Exception("unable to rename File: " +
+								src.getAbsolutePath() +
+							    " To: " + dst.getAbsolutePath());
+		}
+	}
+}
+
+
+

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/Jdbc20Test.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/Jdbc20Test.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/Jdbc20Test.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,44 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.util.Jdbc20Test
+
+   Copyright 1999, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.util;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+
+/////////////////////////////////////////////////////////////////////
+//
+//	Tests the new jdbc 20 method on jdbc 20 getCurrentConnection()
+//	connection to make sure that this indeed is a 20 connection and
+//  not jdbc 1x connection. This test is used by getCurConnJdbc20.sql
+//  from functionTests/conn directory.
+//
+/////////////////////////////////////////////////////////////////////
+public class Jdbc20Test { 
+
+	public static void newToJdbc20Method() throws SQLException {
+		Connection conn = java.sql.DriverManager.getConnection("jdbc:default:connection");
+    	//trying a jdbc20 createStatement. This will only work under jdbc20
+    	Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
+									 ResultSet.CONCUR_READ_ONLY);
+    }
+}

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java	Tue Jan 11 11:53:57 2005
@@ -446,4 +446,103 @@
 	{
 		return id;
 	}
+
+
+	// following methods are originally from a different class - used in the test store/backupRestore1
+	// original comment for that class:
+	/**
+	 * This class provides static methods for checking the consistency of database
+	 * objects like tables.
+	 */
+
+	/**
+	 * Run all of the consistency checkers which do not take parameters.
+	 * Actually, just run the ones that "make sense" to run.  Today,
+	 * that is:
+	 *		countOpens()
+	 *
+	 * @return String		If an inconsistency is found, and if DEBUG is on, 
+	 *						then a string will be returned with more info.  
+	 *						If DEBUG is off, then a simple string will be 
+	 *						returned stating whether or not there are open scans.
+	 *
+	 * @exception StandardException		Thrown on error
+	 * @exception java.sql.SQLException		Thrown on error
+	 */
+	public static String runConsistencyChecker() throws StandardException, java.sql.SQLException
+	{
+		return countOpens() + countDependencies();
+	}
+
+	/**
+	 * Check to make sure that there are no open conglomerates, scans or sorts.
+	 *
+	 * @return String		If an inconsistency is found, and if DEBUG is on, 
+	 *						then a string will be returned with more info.  
+	 *						If DEBUG is off, then a simple string will be 
+	 *						returned stating whether or not there are open scans.
+	 *
+	 * @exception StandardException		Thrown on error
+	 */
+	public static String countOpens() throws StandardException
+	{
+		int						numOpens = 0;
+		LanguageConnectionContext lcc;
+		String					output = "No open scans, etc.\n";
+		TransactionController	tc;
+
+		lcc = (LanguageConnectionContext)
+			ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
+		tc = lcc.getTransactionExecute();
+
+		numOpens = tc.countOpens(TransactionController.OPEN_TOTAL);
+
+		if (numOpens > 0)
+		{
+            output = numOpens + " conglomerates/scans/sorts found open\n";
+
+		}
+
+		return output;
+	}
+
+	/**
+	 * Check to make sure that there are no active dependencies (stored or
+	 * in memory).
+	 *
+	 * @return String		If an inconsistency is found, and if DEBUG is on, 
+	 *						then a string will be returned with more info.  
+	 *						If DEBUG is off, then a simple string will be 
+	 *						returned stating whether or not there are open scans.
+	 *
+	 * @exception StandardException		Thrown on error
+	 * @exception java.sql.SQLException		Thrown on error
+	 */
+	public static String countDependencies() throws StandardException, java.sql.SQLException
+	{
+		int						numDependencies = 0;
+		DataDictionary			dd;
+		DataDictionaryContext	ddc;
+		DependencyManager		dm;
+		StringBuffer			debugBuf = new StringBuffer();
+
+		ddc = (DataDictionaryContext)
+				(ContextService.getContext(DataDictionaryContext.CONTEXT_ID));
+
+		dd = ddc.getDataDictionary();
+		dm = dd.getDependencyManager();
+
+		numDependencies = dm.countDependencies();
+
+		if (numDependencies > 0)
+		{
+			debugBuf.append(numDependencies + " dependencies found");
+		}
+		else
+		{
+			debugBuf.append("No outstanding dependencies.\n");
+		}
+
+		return debugBuf.toString();
+	}
 }

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,88 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.TestRoutines
+
+   Copyright 2004 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.util;
+
+import java.sql.*;
+import java.io.*;
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
+
+/**
+	Utility methods for tests routines, in order to bring some consistency to test output.
+	Any routines added here should be general purpose in nature, not specific to
+	a single test.
+
+	Add a public static method for the test and then add its creation as a procedure
+	or function in installRoutines.
+*/
+public class TestRoutines {
+
+	/**
+		A single procedure to create all the routines in this file.
+		The script to run this is in testRoutines.sql
+	*/
+	public static void installRoutines() throws SQLException {
+
+		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+
+		TestRoutines.installRoutines(conn);
+
+	}
+
+	/**
+		Easy way to install all the routines from a Java test program.
+		Just call with a valid connection.
+		org.apache.derbyTesting.functionTests.util.TestRoutines.installRoutines(conn);
+	*/
+	public static void installRoutines(Connection conn) throws SQLException {
+
+		Statement s = conn.createStatement();
+
+		// setSystemProperty
+		s.execute("CREATE PROCEDURE TESTROUTINE.SET_SYSTEM_PROPERTY(IN PROPERTY_KEY VARCHAR(32000), IN PROPERTY_VALUE VARCHAR(32000)) NO SQL EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.setSystemProperty' language java parameter style java");
+
+		// sleep
+		s.execute("CREATE PROCEDURE TESTROUTINE.SLEEP(IN SLEEP_TIME_MS BIGINT) NO SQL EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.sleep' language java parameter style java");
+
+		s.close();
+	}
+
+
+	/**
+		TESTROUTINE.SET_SYSTEM_PROPERTY(IN PROPERTY_KEY VARCHAR(32000), IN PROPERTY_VALUE VARCHAR(32000))
+		Set a system property
+	*/
+	public static void setSystemProperty(String key, String value) {
+
+		System.getProperties().put(key, value);
+	}
+	/**
+		TESTROUTINE.SLEEP(IN TIME_MS BIGINT)
+		Sleep for a number of milli-seconds.
+	*/
+	public static void sleep(long ms) throws InterruptedException {
+
+		Thread.sleep(ms);
+	}
+}
+
+
+

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/build.xml	Tue Jan 11 11:53:57 2005
@@ -21,7 +21,7 @@
   <property name="this.dir" value="${derby.testing.functest.dir}/util"/>
 
 <!-- Targets -->
-  <target name="util" depends="FTpolicy,compile"/>
+  <target name="util" depends="FTpolicy,compile,copyfiles"/>
   
   <target name="FTpolicy" depends="copyfiles,compile"/>
 
@@ -65,8 +65,9 @@
 
 
   <target name="copyfiles">
-    <copy file="${derby.testing.src.dir}/${derby.testing.functest.dir}/util/nwsvr.policy"
-      todir="${out.dir}/${derby.testing.functest.dir}/util"> 
+    <copy todir="${out.dir}/${derby.testing.functest.dir}/util">
+      <fileset dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/util" 
+        includesfile="${derby.testing.src.dir}/${derby.testing.functest.dir}/util/copyfiles.ant"/>  
     </copy>
   </target>
 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/copyfiles.ant
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/copyfiles.ant?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/copyfiles.ant	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,2 @@
+nwsvr.policy
+testRoutines.sql

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/metadataHelperProcs.java
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/metadataHelperProcs.java?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/metadataHelperProcs.java	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,44 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.store.metadataHelperProcs
+
+   Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.util;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.DatabaseMetaData;
+
+public class metadataHelperProcs {
+	
+   
+	public static ResultSet rs;
+
+	// for use in test getbestrowidentifier.sql
+	public static void getBestRowId(String schema, String tableName, int scope, String nullable, ResultSet[] rs) throws SQLException
+	{
+		Connection conn = DriverManager.getConnection("jdbc:default:connection");
+		boolean tf = true;
+		if (nullable.equals("false"))
+			tf = false;
+		rs[0] = conn.getMetaData().getBestRowIdentifier(null,schema.trim(),tableName.trim(),scope,tf);
+	}
+
+}

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy?view=diff&rev=124918&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy&r1=124917&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy&r2=124918
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/nwsvr.policy	Tue Jan 11 11:53:57 2005
@@ -1,5 +1,5 @@
 //Recommended set of permissions to start & use the network server, 
-//assuming the '${cloudscape.codebase}${/}-' directory has been secured. 
+//assuming the '${derby.codebase}${/}-' directory has been secured. 
 //Fine tune based on your environment settings
 grant codeBase "file:${csinfo.codebase}/-" {
 permission java.io.FilePermission "${derby.system.home}",

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/testRoutines.sql
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/testRoutines.sql?view=auto&rev=124918
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/testRoutines.sql	Tue Jan 11 11:53:57 2005
@@ -0,0 +1,3 @@
+CREATE PROCEDURE TESTROUTINE.INSTALL_ROUTINES() MODIFIES SQL DATA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.TestRoutines.installRoutines' language java parameter style java;  
+CALL TESTROUTINE.INSTALL_ROUTINES();
+DROP PROCEDURE TESTROUTINE.INSTALL_ROUTINES;